Method for coding transform coefficient and device therefor

ABSTRACT

A method by which a decoding device decodes an image includes the steps of: receiving a bitstream including residual information; deriving a residual sample for the current block on the basis of a quantized transform coefficient; and generating a reconstructed picture on the basis of the residual sample for the current block, where the residual information includes a context-based coded context syntax element, where the deriving the quantized transform coefficient decodes the context syntax element based on a context and based on a predetermined maximum value for the context syntax element, and where the maximum value is determined by a unit of a transform block.

CROSS-REFERENCE TO RELATED APPLICATIONS

Pursuant to 35 U.S.C. § 119(e), this application is a continuation ofInternational Application PCT/KR2019/012996, with an internationalfiling date of Oct. 4, 2019, which claims the benefit of U.S.Provisional Patent Application No. 62/741,548, filed on Oct. 5, 2018,the contents of which are hereby incorporated by reference herein in itsentirety.

BACKGROUND OF DISCLOSURE Field of the Disclosure

The present disclosure relates to a transform coefficient coding methodand apparatus therefor of an image coding system.

Related Art

Recently, the demand for high resolution, high quality image/video suchas 4K, 8K or more Ultra High Definition (UHD) image/video is increasingin various fields. As the image/video resolution or quality becomeshigher, relatively more amount of information or bits are transmittedthan for conventional image/video data. Therefore, if image/video dataare transmitted via a medium such as an existing wired/wirelessbroadband line or stored in a legacy storage medium, costs fortransmission and storage are readily increased.

Moreover, interests and demand are growing for virtual reality (VR) andartificial reality (AR) contents, and immersive media such as hologram;and broadcasting of images/videos exhibiting image/video characteristicsdifferent from those of an actual image/video, such as gameimages/videos, are also growing.

Therefore, a highly efficient image/video compression technique isrequired to effectively compress and transmit, store, or play highresolution, high quality images/videos showing various characteristicsas described above.

SUMMARY

The present disclosure is to provide a method and apparatus forimproving image coding efficiency.

The present disclosure is also to provide a method and apparatus forimproving efficiency of residual coding.

The present disclosure is still also to provide a method and apparatusfor improving efficiency of transform coefficient level coding.

The present disclosure is still also to provide a method and apparatusfor performing residual coding in units of not sub-blocks, but transformblocks.

The present disclosure is still also to provide a method and apparatuswhich can improve coding efficiency by determining (or changing) thedecoding order of a parity level flag for a parity of a transformcoefficient level for a quantized transform coefficient, and a firsttransform coefficient level flag related to whether or not a transformcoefficient level is greater than the first threshold value.

The present disclosure is still also to provide a method and apparatuswhich improve coding efficiency by limiting to a predetermined maximumvalue or less, the sum of the number of significant coefficient flagsfor quantized transform coefficients within a current block, the numberof first transform coefficient level flags, the number of parity levelflags, and the number of second transform coefficient level flagsincluded in the residual information.

The present disclosure is still also to provide a method and apparatuswhich reduce data to be context-based coded by limiting to apredetermined maximum value or less, the sum of the number ofsignificant coefficient flags for quantized transform coefficientswithin a current block, the number of first transform coefficient levelflags, the number of parity level flags, and the number of secondtransform coefficient level flags included in the residual information.

According to an embodiment of the present disclosure, an image decodingmethod performed by a decoding apparatus is provided. The methodincludes receiving a bitstream including residual information; derivinga quantized transform coefficient for a current block based on theresidual information included in the bitstream; deriving a residualsample for the current block based on the quantized transformcoefficient; and generating a reconstructed picture based on theresidual sample for the current block, wherein the residual informationincludes a context-based coded context syntax element, wherein thederiving the quantized transform coefficient decodes the context syntaxelement based on a context and based on a predetermined maximum valuefor the context syntax element, and wherein the maximum value isdetermined by a unit of a transform block.

According to another embodiment of the present disclosure, a decodingapparatus for performing image decoding is provided. The decodingapparatus includes an entropy decoder which receives a bitstreamincluding residual information, and derives a quantized transformcoefficient for a current block based on the residual informationincluded in the bitstream; an inverse transformer which derives aresidual sample for the current block based on the quantized transformcoefficient; and an adder which generates a reconstructed picture basedon the residual sample for the current block, wherein the residualinformation includes a context-based coded context syntax element,wherein the deriving the quantized transform coefficient performed bythe entropy decoder decodes the context syntax element based on acontext and based on a predetermined maximum value for the contextsyntax element, and wherein the maximum value is determined by a unit ofa transform block.

According to still another embodiment of the disclosure, there isprovided an image encoding method performed by an encoding apparatus.The method includes deriving a residual sample for a current block;deriving a quantized transform coefficient based on the residual samplefor the current block; and encoding residual information includinginformation on the quantized transform coefficient, wherein the residualinformation includes a context-based coded context syntax element,wherein the deriving the quantized transform coefficient encodes thecontext syntax element based on a context and based on a predeterminedmaximum value for the context syntax element, and wherein the maximumvalue is determined by a unit of a transform block.

According to still another embodiment of the present disclosure, thereis provided an encoding apparatus for performing image encoding. Theencoding apparatus includes a subtractor which derives a residual samplefor a current block, a quantizer which derives a quantized transformcoefficient based on the residual sample for the current block; and anentropy encoder which encodes residual information including informationon the quantized transform coefficient, wherein the deriving thequantized transform coefficient performed by the entropy encoder encodesthe context syntax element based on a context and based on apredetermined maximum value for the context syntax element, and whereinthe maximum value is determined by a unit of a transform block.

According to still another embodiment of the present disclosure, thereis provided a decoder-readable storage medium which stores informationon instructions that cause a video decoding apparatus to performdecoding methods according to some embodiments.

According to still another embodiment of the present disclosure, thereis provided a decoder-readable storage medium which stores informationon instructions that cause a video decoding apparatus to perform adecoding method according to an embodiment.

According to the present disclosure, it is possible to improve overallimage/video compression efficiency.

According to the present disclosure, it is possible to improveefficiency of residual coding.

According to the present disclosure, residual coding may be performed inunits of not sub-blocks, but transform blocks.

According to the present disclosure, it is possible to improve theefficiency of transform coefficient level coding.

According to the present disclosure, by determining (or changing) thedecoding order of the parity level flag for the parity of the transformcoefficient level for the quantized transform coefficient, and the firsttransform coefficient level flag related to whether or not the transformcoefficient level is greater than the first threshold value, codingefficiency can be improved.

The present disclosure can improve coding efficiency by limiting to apredetermined maximum value or less, the sum of the number ofsignificant coefficient flags for quantized transform coefficientswithin a current block, the number of first transform coefficient levelflags, the number of parity level flags, and the number of secondtransform coefficient level flags included in the residual information.

The present disclosure can reduce data to be context-based coded bylimiting to a predetermined maximum value or less, the sum of the numberof significant coefficient flags for quantized transform coefficientswithin a current block, the number of first transform coefficient levelflags, the number of parity level flags, and the number of secondtransform coefficient level flags included in the residual information.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 schematically represents an example of a video/image codingsystem to which the present disclosure may be applied.

FIG. 2 is a diagram schematically illustrating a configuration of avideo/image encoding apparatus to which the present disclosure may beapplied.

FIG. 3 is a diagram schematically illustrating a configuration of avideo/image decoding apparatus to which the present disclosure may beapplied.

FIG. 4 is a diagram illustrating a block diagram of a CABAC encodingsystem according to an embodiment.

FIG. 5 is a diagram illustrating an example of transform coefficients ina 4×4 block.

FIG. 6 is a control flowchart illustrating a residual coding methodaccording to an example.

FIG. 7 is a flowchart showing operation of an encoding apparatusaccording to an embodiment.

FIG. 8 is a block diagram showing a configuration of an encodingapparatus according to an embodiment.

FIG. 9 is a flowchart showing operation of a decoding apparatusaccording to an embodiment.

FIG. 10 is a block diagram showing a configuration of a decodingapparatus according to an embodiment.

FIG. 11 is an example of a contents streaming system to which theembodiments of the present disclosure may be applied.

DESCRIPTION OF EMBODIMENTS

The present disclosure may be modified in various forms, and specificembodiments thereof will be described and illustrated in the drawings.However, the embodiments are not intended for limiting the disclosure.The terms used in the following description are used to merely describespecific embodiments, but are not intended to limit the disclosure. Anexpression of a singular number includes an expression of the pluralnumber, so long as it is clearly read differently. The terms such as“include” and “have” are intended to indicate that features, numbers,steps, operations, elements, components, or combinations thereof used inthe following description exist and it should be thus understood thatthe possibility of existence or addition of one or more differentfeatures, numbers, steps, operations, elements, components, orcombinations thereof is not exclude.

Meanwhile, each component on the drawings described herein isillustrated independently for convenience of description as tocharacteristic functions different from each other, and however, it isnot meant that each component is realized by a separate hardware orsoftware. For example, any two or more of these components may becombined to form a single component, and any single component may bedivided into plural components. The embodiments in which components arecombined and/or divided will belong to the scope of the patent right ofthe present document as long as they do not depart from the essence ofthe present document.

Hereinafter, examples of the present embodiment will be described indetail with reference to the accompanying drawings. In addition, likereference numerals are used to indicate like elements throughout thedrawings, and the same descriptions on the like elements will beomitted.

FIG. 1 illustrates an example of a video/image coding system to whichthe present disclosure may be applied.

This disclosure relates to video/image coding. For example, amethod/embodiment disclosed in the present disclosure may be applied toa method disclosed in the versatile video coding (VVC) standard, theessential video coding (EVC) standard, the AOMedia Video 1 (AV1)standard, the 2nd generation of audio video coding standard (AVS2) orthe next generation video/image coding standard (e.g., H.267, H.268, orthe like).

This disclosure suggests various embodiments of video/image coding, andthe above embodiments may also be performed in combination with eachother unless otherwise specified.

In the present disclosure, a video may refer to a series of images overtime. A picture generally refers to the unit representing one image at aparticular time frame, and a slice/tile refers to the unit constitutinga part of the picture in terms of coding. A slice/tile may include oneor more coding tree units (CTUs). One picture may consist of one or moreslices/tiles. One picture may consist of one or more tile groups. Onetile group may include one or more tiles. A brick may represent arectangular region of CTU rows within a tile in a picture (a brick mayrepresent a rectangular region of CTU rows within a tile in a picture).A tile may be partitioned into a multiple bricks, each of which may beconstructed with one or more CTU rows within the tile (A tile may bepartitioned into multiple bricks, each of which consisting of one ormore CTU rows within the tile). A tile that is not partitioned intomultiple bricks may also be referred to as a brick. A brick scan mayrepresent a specific sequential ordering of CTUs partitioning a picture,wherein the CTUs may be ordered in a CTU raster scan within a brick, andbricks within a tile may be ordered consecutively in a raster scan ofthe bricks of the tile, and tiles in a picture may be orderedconsecutively in a raster scan of the tiles of the picture (A brick scanis a specific sequential ordering of CTUs partitioning a picture inwhich the CTUs are ordered consecutively in CTU raster scan in a brick,bricks within a tile are ordered consecutively in a raster scan of thebricks of the tile, and tiles in a picture are ordered consecutively ina raster scan of the tiles of the picture). A tile is a particular tilecolumn and a rectangular region of CTUs within a particular tile column(A tile is a rectangular region of CTUs within a particular tile columnand a particular tile row in a picture). The tile column is arectangular region of CTUs, which has a height equal to the height ofthe picture and a width that may be specified by syntax elements in thepicture parameter set (The tile column is a rectangular region of CTUshaving a height equal to the height of the picture and a width specifiedby syntax elements in the picture parameter set). The tile row is arectangular region of CTUs, which has a width specified by syntaxelements in the picture parameter set and a height that may be equal tothe height of the picture (The tile row is a rectangular region of CTUshaving a height specified by syntax elements in the picture parameterset and a width equal to the width of the picture). A tile scan mayrepresent a specific sequential ordering of CTUs partitioning a picture,and the CTUs may be ordered consecutively in a CTU raster scan in atile, and tiles in a picture may be ordered consecutively in a rasterscan of the tiles of the picture (A tile scan is a specific sequentialordering of CTUs partitioning a picture in which the CTUs are orderedconsecutively in CTU raster scan in a tile whereas tiles in a pictureare ordered consecutively in a raster scan of the tiles of the picture).A slice may include an integer number of bricks of a picture, and theinteger number of bricks may be included in a single NAL unit (A sliceincludes an integer number of bricks of a picture that may beexclusively contained in a single NAL unit). A slice may be constructedwith multiple complete tiles, or may be a consecutive sequence ofcomplete bricks of one tile (A slice may consists of either a number ofcomplete tiles or only a consecutive sequence of complete bricks of onetile). In the present disclosure, a tile group and a slice may be usedin place of each other. For example, in the present disclosure, a tilegroup/tile group header may be referred to as a slice/slice header.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). Also, ‘sample’ may be used as a term corresponding to a pixel. Asample may generally represent a pixel or a value of a pixel, and mayrepresent only a pixel/pixel value of a luma component or only apixel/pixel value of a chroma component.

A unit may represent a basic unit of image processing. The unit mayinclude at least one of a specific region of the picture and informationrelated to the region. One unit may include one luma block and twochroma (ex. cb, cr) blocks. The unit may be used interchangeably withterms such as block or area in some cases. In a general case, an M×Nblock may include samples (or sample arrays) or a set (or array) oftransform coefficients of M columns and N rows.

In the present disclosure, the symbol“/” and “,” should be interpretedas “and/or.” For example, the expression “A/B” is interpreted as “Aand/or B”, and the expression “A, B” is interpreted as “A and/or B.”Additionally, the expression “A/B/C” means “at least one of A, B, and/orC.” Further, the expression “A, B, C” also means “at least one of A, B,and/or C.” (In the present disclosure, the term “/” and “,” should beinterpreted to indicate “and/or.” For instance, the expression “A/B” maymean “A and/or B.” Further, “A, B” may mean “A and/or B.” Further,“A/B/C” may mean “at least one of A, B, and/or C.” Also, “A/B/C” maymean “at least one of A, B, and/or C.”)

Additionally, in the present disclosure, the term “or” should beinterpreted as “and/or.” For example, the expression “A or B” maymean 1) only “A”, 2) only “B”, and/or 3) “both A and B.” In other words,the term “or” in the present disclosure may mean “additionally oralternatively.” (Further, in the disclosure, the term “or” should beinterpreted to indicate “and/or.” For instance, the expression “A or B”may comprise 1) only A, 2) only B, and/or 3) both A and B. In otherwords, the term “or” in the present disclosure should be interpreted toindicate “additionally or alternatively.”)

Referring to FIG. 1, a video/image coding system may include a sourcedevice and a reception device. The source device may transmit encodedvideo/image information or data to the reception device through adigital storage medium or network in the form of a file or streaming.

The source device may include a video source, an encoding apparatus, anda transmitter. The receiving device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component.

The video source may acquire video/image through a process of capturing,synthesizing, or generating the video/image. The video source mayinclude a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, and the like. The video/image generating device mayinclude, for example, computers, tablets and smartphones, and may(electronically) generate video/images. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode input video/image. The encodingapparatus may perform a series of process such as prediction, transform,and quantization for compaction and coding efficiency. The encoded data(encoded video/image information) may be output in the form of abitstream.

The transmitter may transmit the encoded image/image information or dataoutput in the form of a bitstream to the receiver of the receivingdevice through a digital storage medium or a network in the form of afile or streaming. The digital storage medium may include variousstorage mediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and thelike. The transmitter may include an element for generating a media filethrough a predetermined file format and may include an element fortransmission through a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received bitstream to thedecoding apparatus.

The decoding apparatus may decode the video/image by performing a seriesof processes such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

FIG. 2 is a diagram schematically illustrating a configuration of avideo/image encoding apparatus to which the present disclosure may beapplied. Hereinafter, what is referred to as the video encodingapparatus may include an image encoding apparatus.

Referring to FIG. 2, the encoding apparatus 200 may include and beconfigured with an image partitioner 210, a predictor 220, a residualprocessor 230, an entropy encoder 240, an adder 250, a filter 260, and amemory 270. The predictor 220 may include an inter predictor 221 and anintra predictor 222. The residual processor 230 may include atransformer 232, a quantizer 233, a dequantizer 234, and an inversetransformer 235. The residual processor 230 may further include asubtractor 231. The adder 250 may be called a reconstructor orreconstructed block generator. The image partitioner 210, the predictor220, the residual processor 230, the entropy encoder 240, the adder 250,and the filter 260, which have been described above, may be configuredby one or more hardware components (e.g., encoder chipsets orprocessors) according to an embodiment. In addition, the memory 270 mayinclude a decoded picture buffer (DPB), and may also be configured by adigital storage medium. The hardware component may further include thememory 270 as an internal/external component.

The image partitioner 210 may split an input image (or, picture, frame)input to the encoding apparatus 200 into one or more processing units.As an example, the processing unit may be called a coding unit (CU). Inthis case, the coding unit may be recursively split according to aQuad-tree binary-tree ternary-tree (QTBTTT) structure from a coding treeunit (CTU) or the largest coding unit (LCU). For example, one codingunit may be split into a plurality of coding units of a deeper depthbased on a quad-tree structure, a binary-tree structure, and/or aternary-tree structure. In this case, for example, the quad-treestructure is first applied and the binary-tree structure and/or theternary-tree structure may be later applied. Alternatively, thebinary-tree structure may also be first applied. A coding processaccording to the present disclosure may be performed based on a finalcoding unit which is not split any more. In this case, based on codingefficiency according to image characteristics or the like, the maximumcoding unit may be directly used as the final coding unit, or asnecessary, the coding unit may be recursively split into coding units ofa deeper depth, such that a coding unit having an optimal size may beused as the final coding unit. Here, the coding process may include aprocess such as prediction, transform, and reconstruction to bedescribed later. As another example, the processing unit may furtherinclude a prediction unit (PU) or a transform unit (TU). In this case,each of the prediction unit and the transform unit may be split orpartitioned from the aforementioned final coding unit. The predictionunit may be a unit of sample prediction, and the transform unit may be aunit for inducing a transform coefficient and/or a unit for inducing aresidual signal from the transform coefficient.

The unit may be interchangeably used with the term such as a block or anarea in some cases. Generally, an M×N block may represent samplescomposed of M columns and N rows or a group of transform coefficients.The sample may generally represent a pixel or a value of the pixel, andmay also represent only the pixel/pixel value of a luma component, andalso represent only the pixel/pixel value of a chroma component. Thesample may be used as the term corresponding to a pixel or a pelconfiguring one picture (or image).

The encoding apparatus 200 may generate a residual signal (residualblock, residual sample array) by subtracting a predicted signal(predicted block, prediction sample array) output from the interpredictor 221 or the intra predictor 222 from the input image signal(original block, original sample array), and the generated residualsignal is transmitted to the transformer 232. In this case, asillustrated, the unit for subtracting the predicted signal (predictedblock, prediction sample array) from the input image signal (originalblock, original sample array) within an encoder 200 may be called thesubtractor 231. The predictor may perform prediction for a block to beprocessed (hereinafter, referred to as a current block), and generate apredicted block including prediction samples of the current block. Thepredictor may determine whether intra prediction is applied or interprediction is applied in units of the current block or the CU. Thepredictor may generate various information about prediction, such asprediction mode information, to transfer the generated information tothe entropy encoder 240 as described later in the description of eachprediction mode. The information about prediction may be encoded by theentropy encoder 240 to be output in a form of the bitstream.

The intra predictor 222 may predict a current block with reference tosamples within a current picture. The referenced samples may be locatedneighboring to the current block, or may also be located away from thecurrent block according to the prediction mode. The prediction modes inthe intra prediction may include a plurality of non-directional modesand a plurality of directional modes. The non-directional mode mayinclude, for example, a DC mode or a planar mode. The directional modemay include, for example, 33 directional prediction modes or 65directional prediction modes according to the fine degree of theprediction direction. However, this is illustrative and the directionalprediction modes which are more or less than the above number may beused according to the setting. The intra predictor 222 may alsodetermine the prediction mode applied to the current block using theprediction mode applied to the neighboring block.

The inter predictor 221 may induce a predicted block of the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. At this time, in order to decreasethe amount of motion information transmitted in the inter predictionmode, the motion information may be predicted in units of blocks, asub-blocks, or samples based on the correlation of the motioninformation between the neighboring block and the current block. Themotion information may include a motion vector and a reference pictureindex. The motion information may further include inter predictiondirection (L0 prediction, L1 prediction, Bi prediction, or the like)information. In the case of the inter prediction, the neighboring blockmay include a spatial neighboring block existing within the currentpicture and a temporal neighboring block existing in the referencepicture. The reference picture including the reference block and thereference picture including the temporal neighboring block may also bethe same as each other, and may also be different from each other. Thetemporal neighboring block may be called the name such as a collocatedreference block, a collocated CU (colCU), or the like, and the referencepicture including the temporal neighboring block may also be called acollocated picture (colPic). For example, the inter predictor 221 mayconfigure a motion information candidate list based on the neighboringblocks, and generate information indicating what candidate is used toderive the motion vector and/or the reference picture index of thecurrent block. The inter prediction may be performed based on variousprediction modes, and for example, in the case of a skip mode and amerge mode, the inter predictor 221 may use the motion information ofthe neighboring block as the motion information of the current block. Inthe case of the skip mode, the residual signal may not be transmittedunlike the merge mode. A motion vector prediction (MVP) mode mayindicate the motion vector of the current block by using the motionvector of the neighboring block as a motion vector predictor, andsignaling a motion vector difference.

The predictor 200 may generate a predicted signal based on variousprediction methods to be described later. For example, the predictor maynot only apply the intra prediction or the inter prediction forpredicting one block, but also simultaneously apply the intra predictionand the inter prediction. This may be called a combined inter and intraprediction (CIIP). Further, the predictor may be based on an intra blockcopy (IBC) prediction mode, or a palette mode in order to performprediction on a block. The IBC prediction mode or palette mode may beused for content image/video coding of a game or the like, such asscreen content coding (SCC). The IBC basically performs prediction in acurrent picture, but it may be performed similarly to inter predictionin that it derives a reference block in a current picture. That is, theIBC may use at least one of inter prediction techniques described in thepresent disclosure. The palette mode may be regarded as an example ofintra coding or intra prediction. When the palette mode is applied, asample value in a picture may be signaled based on information on apalette index and a palette table.

The predicted signal generated through the predictor (including theinter predictor 221 and/or the intra predictor 222) may be used togenerate a reconstructed signal or used to generate a residual signal.The transformer 232 may generate transform coefficients by applying thetransform technique to the residual signal. For example, the transformtechnique may include at least one of a discrete cosine transform (DCT),a discrete sine transform (DST), a Karhunen-Loève transform (KLT), agraph-based transform (GBT), or a conditionally non-linear transform(CNT). Here, when the relationship information between pixels isillustrated as a graph, the GBT means the transform obtained from thegraph. The CNT means the transform which is acquired based on apredicted signal generated by using all previously reconstructed pixels.In addition, the transform process may also be applied to a pixel blockhaving the same size of the square, and may also be applied to the blockhaving a variable size rather than the square.

The quantizer 233 may quantize the transform coefficients to transmitthe quantized transform coefficients to the entropy encoder 240, and theentropy encoder 240 may encode the quantized signal (information aboutthe quantized transform coefficients) to the encoded quantized signal tothe bitstream. The information about the quantized transformcoefficients may be called residual information. The quantizer 233 mayrearrange the quantized transform coefficients having a block form in aone-dimensional vector form based on a coefficient scan order, and alsogenerate the information about the quantized transform coefficientsbased on the quantized transform coefficients of the one dimensionalvector form. The entropy encoder 240 may perform various encodingmethods, for example, such as an exponential Golomb coding, acontext-adaptive variable length coding (CAVLC), and a context-adaptivebinary arithmetic coding (CABAC). The entropy encoder 240 may alsoencode information (e.g., values of syntax elements and the like)necessary for reconstructing video/image other than the quantizedtransform coefficients together or separately. The encoded information(e.g., encoded video/image information) may be transmitted or stored inunits of network abstraction layer (NAL) unit in a form of thebitstream. The video/image information may further include informationabout various parameter sets such as an adaptation parameter set (APS),a picture parameter set (PPS), a sequence parameter set (SPS), or avideo parameter set (VPS). In addition, the video/image information mayfurther include general constraint information. The signaled/transmittedinformation and/or syntax elements to be described later in the presentdisclosure may be encoded through the aforementioned encoding processand thus included in the bitstream. The bitstream may be transmittedthrough a network, or stored in a digital storage medium. Here, thenetwork may include a broadcasting network and/or a communicationnetwork, or the like, and the digital storage medium may include variousstorage media such as USB, SD, CD, DVD, Blue-ray, HDD, and SSD. Atransmitter (not illustrated) for transmitting the signal output fromthe entropy encoder 240 and/or a storage (not illustrated) for storingthe signal may be configured as the internal/external elements of theencoding apparatus 200, or the transmitter may also be included in theentropy encoder 240.

The quantized transform coefficients output from the quantizer 233 maybe used to generate a predicted signal. For example, the dequantizer 234and the inverse transformer 235 apply dequantization and inversetransform to the quantized transform coefficients, such that theresidual signal (residual block or residual samples) may bereconstructed. The adder 250 adds the reconstructed residual signal tothe predicted signal output from the inter predictor 221 or the intrapredictor 222, such that the reconstructed signal (reconstructedpicture, reconstructed block, reconstructed sample array) may begenerated. As in the case where the skip mode is applied, if there is noresidual for the block to be processed, the predicted block may be usedas the reconstructed block. The adder 250 may be called a reconstructoror a reconstructed block generator. The generated reconstructed signalmay be used for the intra prediction of the next block to be processedwithin the current picture, and as described later, also used for theinter prediction of the next picture through filtering.

Meanwhile, a luma mapping with chroma scaling (LMCS) may also be appliedin a picture encoding and/or reconstruction process.

The filter 260 may apply filtering to the reconstructed signal, therebyimproving subjective/objective image qualities. For example, the filter260 may apply various filtering methods to the reconstructed picture togenerate a modified reconstructed picture, and store the modifiedreconstructed picture in the memory 270, specifically, the DPB of thememory 270. Various filtering methods may include, for example, adeblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like. The filter 260 may generate variousfiltering-related information to transfer the generated information tothe entropy encoder 240, as described later in the description of eachfiltering method. The filtering-related information may be encoded bythe entropy encoder 240 to be output in a form of the bitstream.

The modified reconstructed picture transmitted to the memory 270 may beused as the reference picture in the inter predictor 221. If the interprediction is applied by the inter predictor, the encoding apparatus mayavoid the prediction mismatch between the encoding apparatus 200 and thedecoding apparatus, and also improve coding efficiency.

The DPB of the memory 270 may store the modified reconstructed pictureto be used as the reference picture in the inter predictor 221. Thememory 270 may store motion information of the block in which the motioninformation within the current picture is derived (or encoded) and/ormotion information of the blocks within the previously reconstructedpicture. The stored motion information may be transferred to the interpredictor 221 to be utilized as motion information of the spatialneighboring block or motion information of the temporal neighboringblock. The memory 270 may store the reconstructed samples of thereconstructed blocks within the current picture, and transfer thereconstructed samples to the intra predictor 222.

FIG. 3 is a diagram for schematically explaining a configuration of avideo/image decoding apparatus to which the present disclosure isapplicable.

Referring to FIG. 3, the decoding apparatus 300 may include andconfigured with an entropy decoder 310, a residual processor 320, apredictor 330, an adder 340, a filter 350, and a memory 360. Thepredictor 330 may include an inter predictor 331 and an intra predictor332. The residual processor 320 may include a dequantizer 321 and aninverse transformer 322. The entropy decoder 310, the residual processor320, the predictor 330, the adder 340, and the filter 350, which havebeen described above, may be configured by one or more hardwarecomponents (e.g., decoder chipsets or processors) according to anembodiment. Further, the memory 360 may include a decoded picture buffer(DPB), and may be configured by a digital storage medium. The hardwarecomponent may further include the memory 360 as an internal/externalcomponent.

When the bitstream including the video/image information is input, thedecoding apparatus 300 may reconstruct the image in response to aprocess in which the video/image information is processed in theencoding apparatus illustrated in FIG. 2. For example, the decodingapparatus 300 may derive the units/blocks based on block split-relatedinformation acquired from the bitstream. The decoding apparatus 300 mayperform decoding using the processing unit applied to the encodingapparatus. Therefore, the processing unit for the decoding may be, forexample, a coding unit, and the coding unit may be split according tothe quad-tree structure, the binary-tree structure, and/or theternary-tree structure from the coding tree unit or the maximum codingunit. One or more transform units may be derived from the coding unit.In addition, the reconstructed image signal decoded and output throughthe decoding apparatus 300 may be reproduced through a reproducingapparatus.

The decoding apparatus 300 may receive the signal output from theencoding apparatus illustrated in FIG. 2 in a form of the bitstream, andthe received signal may be decoded through the entropy decoder 310. Forexample, the entropy decoder 310 may derive information (e.g.,video/image information) necessary for the image reconstruction (orpicture reconstruction) by parsing the bitstream. The video/imageinformation may further include information about various parameter setssuch as an adaptation parameter set (APS), a picture parameter set(PPS), a sequence parameter set (SPS), and a video parameter set (VPS).In addition, the video/image information may further include generalconstraint information. The decoding apparatus may decode the picturefurther based on the information about the parameter set and/or thegeneral constraint information. The signaled/received information and/orsyntax elements to be described later in the present disclosure may bedecoded through the decoding process and acquired from the bitstream.For example, the entropy decoder 310 may decode information within thebitstream based on a coding method such as an exponential Golomb coding,a CAVLC, or a CABAC, and output a value of the syntax element necessaryfor the image reconstruction, and the quantized values of theresidual-related transform coefficient. More specifically, the CABACentropy decoding method may receive a bin corresponding to each syntaxelement from the bitstream, determine a context model using syntaxelement information to be decoded and decoding information of theneighboring block and the block to be decoded or information of thesymbol/bin decoded in the previous stage, and generate a symbolcorresponding to a value of each syntax element by predicting theprobability of generation of the bin according to the determined contextmodel to perform the arithmetic decoding of the bin. At this time, theCABAC entropy decoding method may determine the context model and thenupdate the context model using the information of the decoded symbol/binfor a context model of a next symbol/bin. The information aboutprediction among the information decoded by the entropy decoder 310 maybe provided to the predictor (the inter predictor 332 and the intrapredictor 331), and a residual value at which the entropy decoding isperformed by the entropy decoder 310, that is, the quantized transformcoefficients and the related parameter information may be input to theresidual processor 320. The residual processor 320 may derive a residualsignal (residual block, residual samples, residual sample array). Inaddition, the information about filtering among the information decodedby the entropy decoder 310 may be provided to the filter 350. Meanwhile,a receiver (not illustrated) for receiving the signal output from theencoding apparatus may be further configured as the internal/externalelement of the decoding apparatus 300, or the receiver may also be acomponent of the entropy decoder 310. Meanwhile, the decoding apparatusaccording to the present disclosure may be called a video/image/picturedecoding apparatus, and the decoding apparatus may also be classifiedinto an information decoder (video/image/picture information decoder)and a sample decoder (video/image/picture sample decoder). Theinformation decoder may include the entropy decoder 310, and the sampledecoder may include at least one of the dequantizer 321, the inversetransformer 322, the adder 340, the filter 350, the memory 360, theinter predictor 332, and the intra predictor 331.

The dequantizer 321 may dequantize the quantized transform coefficientsto output the transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in a two-dimensional block form. Inthis case, the rearrangement may be performed based on a coefficientscan order performed by the encoding apparatus. The dequantizer 321 mayperform dequantization for the quantized transform coefficients using aquantization parameter (e.g., quantization step size information), andacquire the transform coefficients.

The inverse transformer 322 inversely transforms the transformcoefficients to acquire the residual signal (residual block, residualsample array).

The predictor 330 may perform the prediction of the current block, andgenerate a predicted block including the prediction samples of thecurrent block. The predictor may determine whether the intra predictionis applied or the inter prediction is applied to the current block basedon the information about prediction output from the entropy decoder 310,and determine a specific intra/inter prediction mode.

The predictor may generate the predicted signal based on variousprediction methods to be described later. For example, the predictor maynot only apply the intra prediction or the inter prediction for theprediction of one block, but also apply the intra prediction and theinter prediction at the same time. This may be called a combined interand intra prediction (CIIP). Further, the predictor may be based on anintra block copy (IBC) prediction mode, or a palette mode in order toperform prediction on a block. The IBC prediction mode or palette modemay be used for content image/video coding of a game or the like, suchas screen content coding (SCC). The IBC basically performs prediction ina current picture, but it may be performed similarly to inter predictionin that it derives a reference block in a current picture. That is, theIBC may use at least one of inter prediction techniques described in thepresent disclosure. The palette mode may be regarded as an example ofintra coding or intra prediction. When the palette mode is applied,information on a palette table and a palette index may be included inthe video/image information and signaled.

The intra predictor 331 may predict the current block with reference tothe samples within the current picture. The referenced samples may belocated neighboring to the current block according to the predictionmode, or may also be located away from the current block. The predictionmodes in the intra prediction may include a plurality of non-directionalmodes and a plurality of directional modes. The intra predictor 331 mayalso determine the prediction mode applied to the current block usingthe prediction mode applied to the neighboring block.

The inter predictor 332 may induce the predicted block of the currentblock based on the reference block (reference sample array) specified bythe motion vector on the reference picture. At this time, in order todecrease the amount of the motion information transmitted in the interprediction mode, the motion information may be predicted in units ofblocks, a sub-blocks, or samples based on the correlation of the motioninformation between the neighboring block and the current block. Themotion information may include a motion vector and a reference pictureindex. The motion information may further include inter predictiondirection (L0 prediction, L1 prediction, Bi prediction, or the like)information. In the case of the inter prediction, the neighboring blockmay include a spatial neighboring block existing within the currentpicture and a temporal neighboring block existing in the referencepicture. For example, the inter predictor 332 may configure a motioninformation candidate list based on the neighboring blocks, and derivethe motion vector and/or the reference picture index of the currentblock based on received candidate selection information. The interprediction may be performed based on various prediction modes, and theinformation about the prediction may include information indicating themode of the inter prediction of the current block.

The adder 340 may add the acquired residual signal to the predictedsignal (predicted block, prediction sample array) output from thepredictor (including the inter predictor 332 and/or the intra predictor331) to generate the reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array). As in the case wherethe skip mode is applied, if there is no residual for the block to beprocessed, the predicted block may be used as the reconstructed block.

The adder 340 may be called a reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for the intraprediction of a next block to be processed within the current picture,and as described later, may also be output through filtering or may alsobe used for the inter prediction of a next picture.

Meanwhile, a luma mapping with chroma scaling (LMCS) may also be appliedin the picture decoding process.

The filter 350 may apply filtering to the reconstructed signal, therebyimproving the subjective/objective image qualities. For example, thefilter 350 may apply various filtering methods to the reconstructedpicture to generate a modified reconstructed picture, and transmit themodified reconstructed picture to the memory 360, specifically, the DPBof the memory 360. Various filtering methods may include, for example, adeblocking filtering, a sample adaptive offset, an adaptive loop filter,a bidirectional filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 360may be used as the reference picture in the inter predictor 332. Thememory 360 may store motion information of the block in which the motioninformation within the current picture is derived (decoded) and/ormotion information of the blocks within the previously reconstructedpicture. The stored motion information may be transferred to the interpredictor 260 to be utilized as motion information of the spatialneighboring block or motion information of the temporal neighboringblock. The memory 360 may store the reconstructed samples of thereconstructed blocks within the current picture, and transfer the storedreconstructed samples to the intra predictor 331.

In the present specification, the exemplary embodiments described in thefilter 260, the inter predictor 221, and the intra predictor 222 of theencoding apparatus 200 may be applied equally to or to correspond to thefilter 350, the inter predictor 332, and the intra predictor 331 of thedecoding apparatus 300, respectively.

Meanwhile, as described above, in performing video coding, prediction isperformed to improve compression efficiency. Through this, a predictedblock including prediction samples for a current block as a block to becoded (i.e., a coding target block) may be generated. Here, thepredicted block includes prediction samples in a spatial domain (orpixel domain). The predicted block is derived in the same manner in anencoding apparatus and a decoding apparatus, and the encoding apparatusmay signal information (residual information) on residual between theoriginal block and the predicted block, rather than an original samplevalue of an original block, to the decoding apparatus, therebyincreasing image coding efficiency. The decoding apparatus may derive aresidual block including residual samples based on the residualinformation, add the residual block and the predicted block to generatereconstructed blocks including reconstructed samples, and generate areconstructed picture including the reconstructed blocks.

The residual information may be generated through a transform andquantization process. For example, the encoding apparatus may derive aresidual block between the original block and the predicted block,perform a transform process on residual samples (residual sample array)included in the residual block to derive transform coefficients, performa quantization process on the transform coefficients to derive quantizedtransform coefficients, and signal related residual information to thedecoding apparatus (through a bit stream). Here, the residualinformation may include value information of the quantized transformcoefficients, position information, a transform technique, a transformkernel, a quantization parameter, and the like. The decoding apparatusmay perform dequantization/inverse transform process based on theresidual information and derive residual samples (or residual blocks).The decoding apparatus may generate a reconstructed picture based on thepredicted block and the residual block. Also, for reference for interprediction of a picture afterward, the encoding apparatus may alsodequantize/inverse-transform the quantized transform coefficients toderive a residual block and generate a reconstructed picture basedthereon.

FIG. 4 shows a block diagram of context-adaptive binary arithmeticcoding (CABAC) for encoding a single syntax element, as a diagramillustrating a block diagram of a CABAC encoding system according to anembodiment.

In a case where an input signal is a non-binarized syntax element, anencoding process of the CABAC first converts the input signal into abinarized value through binarization. In a case where an input signal isalready a binarized value, the input signal bypasses the binarizationwithout being subject to it, and input to an encoding engine. Here, eachbinary number 0 or 1 constituting the binary value is referred to as abin. For example, in a case where a binary string after the binarizationis ‘110’, each of 1, 1, and 0 is referred to as a bin. The bin(s) for asyntax element may be a value of the syntax element.

Binarized bins are input to a regular encoding engine or a bypassencoding engine.

The regular encoding engine assigns to a corresponding bin a contextmodel reflecting a probability value, and encodes the bin based on theassigned context model. After performing the encoding on each bin, theregular encoding engine may update a probability model for the bin. Thethus encoded bins are referred to as context-encoded bins.

The bypass encoding engine omits a process of estimating a probabilityfor an input bin, and a process of updating the probability model whichhas been applied to the bin, after the encoding. The bypass encodingengine improves an encoding speed by encoding bins being input theretowhile applying uniform probability distribution instead of assigning acontext. The thus encoded bins are referred to as bypass bins.

The entropy encoding may determine whether to perform the encodingthrough the regular encoding engine or through the bypass encodingengine, and switch an encoding path. The entropy decoding performs thesame processes as those of the encoding in a reverse order.

Meanwhile, in an embodiment, a (quantized) transform coefficient isencoded and/or decoded based on syntax elements, such astransform_skip_flag, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix,last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, coded_sub_block_flag,sig_coeff_flag, par_level_flag, rem_abs_gt1_flag, rem_abs_gt2_flag,abs_remainder, coeff_sign_flag, mts_idx and the like. Table 1 belowshows syntax elements related to the residual data encoding according toan example.

TABLE 1 residual_coding( x0, y0, log2TbWidth, log2TbHeight, cIdx ) {Descriptor  if( transform_skip_enabled_flag && (cIdx ! = 0 ||cu_mts_flag[ x0 ][ y0 ] = = 0) &&   (log2TbWidth <= 2) && (log2TbHeight<= 2 ) )   transform_skip_flag[ x0 ][ y0 ] cIdx] ac(v) last_sig_coeff_x_prefix ac(v)  last_sig_coeff_y_prefix ac(v)  if(last_sig_coeff_x_prefix > 3 )   last_sig_coeff_x_suffix ac(v)  if(last_sig_coeff_y_prefix > 3 )   last_sig_coeff_y_suffix ac(v) log2SbSize = ( Min( log2TbWidth, log2TbHeight ) < 2 ? 1 : 2) numSbCoeff = 1 << ( log2SbSize << 1 )  lastScanPos = numSbCoeff lastSubBlock = ( 1 << ( log2TbWidth + log2TbHeight − 2 * log2SbSize ) )− 1  do {   if( lastScanPos = = 0 ) {    lastScanPos = numSbCoeff   lastSubBlock − −   }   lastScanPos − −   xS = DiagScanOrder[log2TbWidth − log2SbSize ][ log2TbHeight − log2SbSize]     [lastSubBlock ][ 0 ]   yS = DiagScanOrder[ log2TbWidth − log2SbSize ][log2TbHeight − log2SbSize]     [ lastSubBlock ][ 1 ]   xC = ( xS <<log2SbSize ) +    DiagScanOrder[ log2SbSize ][ log2SbSize ][ lastScanPos][ 0 ]   yC = ( yS << log2SbSize ) +    DiagScanOrder[ log2SbSize ][log2SbSize ][ lastScanPos ][ 1 ]  } while( ( xC != LastSignificantCoeffX) || ( yC != LastSignificantCoeffY ) )  QState = 0  for( i =lastSubBlock; i >= 0; i − − ) {   startQStateSb = QState   xS =DiagScanOrder[ log2TbWidth − log2SbSize ][ log2TbHeight − log2SbSize]    [ lastSubBlock ][ 0 ]   yS = DiagScanOrder[ log2TbWidth − log2SbSize][ log2TbHeight − log2SbSize]     [ lastSubBlock ][ 1 ]  inferSbDcSigCoeffFlag = 0   if( ( i < lastSubBlock ) && ( i > 0 ) ) {   coded_sub_block_flag[ xS ][ yS ] ac(v)    inferSbDcSigCoeffFlag = 1  }   firstSigScanPosSb = numSbCoeff   lastSigScanPosSb = −1   for( n =( i = = lastSubBlock ) ? lastScanPos − 1 ; numSbCoeff − 1; n >= 0; n− −) {   xC = ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][log2SbSize ][ n ][ 0 ]   yC = ( yS << log2SbSize ) + DiagScanOrder[log2SbSize ][ log2SbSize ][ n ][ 1 ]   if( coded_sub_block_flag[ xS ][yS ] && ( n > 0 || !inferSbDcSigCoeffFlag ) ) {    sig_coeff_flag[ xC ][yC ] ac(v)   }   if( sig_coeff_flag[ xC ][ yC ] {    per_level_flag[ n ]ac(v)    rem_abs_gt1_flag[ n ] ac(v)    if( lastSigScanPosSb = = −1 )    lastSigScanPosSb = n    firstSigScanPosSb = n   }   AbsLevelPass1[xC ][ yC ] =     sig_coeff_flag[ xC ][ yC ] + par_level_flag[ n ] + 2 *rem_abs_gt1_flag[ n ]   if( dep_quant_enabled_flag )    QState =QStateTransTable[ QState ][ par_level_flag[ n ] ]  }  for( n =numSbCoeff − 1; a >= 0; n− − ){   if( rem_abs_gt1_flag[ n ] )   rem_abs_gt2_flag[ n ] ac(v)  }  for( n = numSbCoeff − 1; n >= 0; n−−) {   xC = ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][log2SbSize ][ n ][ 0 ]   yC = ( yS << log2SbSize ) + DiagScanOrder[log2SbSize ][ log2SbSize ][ n ][ 1 ]   if( rem_abs_gt2_flag[ n ] )   abs_remainder[ n ]   AbsLevel[ xC ][ yC ] = AbsLebelPass1[ xC ][ yC] +     2 * ( rem_abs_gt2_flag[ n ] + abs_remainder[ n ] )  }  if(dep_quant_enabled_flag || !sign_data_hiding_enabled_flag )   signHidden= 0  else   signHidden = ( lastSigScanPosSb − firstSigScanPosSb > 3 ? 1: 0 )  for( n = numSbCoeff − 1; n >= 0; n− − ) {   xC = ( xS <<log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]   yC= ( yS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][1 ]   if( sig_coeff_flag[ xC ][ yC ] &&   (!signHidden || ( n !=firstSigScanPosSb ) ) )   coeff_sign_flag[ n ] ac(v)  }  if(dep_quant_enabled_flag ) {   QState = startQStateSb   for( n =numSbCoeff − 1; n >= 0; n− −) {   xC = ( xS << log2SbSize ) +   DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]   yC = ( yS <<log2SbSize ) +    DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]  if( sig_coeff_flag[ xC ][ yC ] )    TransCoeffLevel[ x0 ][ y0 ][ cIdx][ xC ][ yC ] =     ( 2 * AbsLevel[ xC ][ yC ] − (QState > 1 ? 1 : 0 )) *     ( 1 − 2 * coeff_sign_flag[ n ] {   QState = QStateTransTable[QState ][ par_level_flag[ n ] ] } else {  sumAbsLevel = 0  for( n =numSbCoeff − 1: n >= 0; n− − ) {   xC = ( xS << log2SbSize ) +   DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]   yC = ( yS <<log2SbSize ) +    DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]  if( sig_coeff_flag[ xC ][ yC ] ) {    TransCoeffLevel[ x0 ] [ y0 ][cIdx ][ xC ][ yC ] =     AbsLevel[ xC ][ yC ] * ( 1 − 2 *coeff_sign_flag[ n ] )    if( signHidden ) {     sumAbsLevel +=AbsLevel[ xC ][ yC ]     if( ( n = = firstSigScanPosSb ) && (sumAbsLevel% 2 ) = = 1 ) )      TransCoeffLevel[ x0 ][ y0 ][ cfdx ][ xC ][yC ] =      − TransCoeffLevel[ x0 ][ y0 ][ cfdx ][ xC ][yC ]     }    }   }  }} if( cu_mts_flag[ x0 ][ y0 ] && (cIdx = = 0 ) &&  !transform_skip_flag[x0 ][ y0 ][ cIdx ] &&  ( ( CuPredMode[ x0 ][ y0 ] = = MODE_INTRA &&numSigCoff > 2 ) | [   CuPredMode[ x0 ][ y0 ] = = MODE_INTER ) ) ) { mts_idx[ x0 ][ y0 ] ac(v) }

transform_skip_flag indicates whether or not a transform for anassociated block is skipped. The associated block may be a coding block(CB) or a transform block (TB). In connection with the transform (andthe quantization) and the residual coding process, the CB and the TB maybe used interchangeably. For example, as described above, residualsamples for the CB may be derived, and (quantized) transformcoefficients may be derived through transform and quantization on theresidual samples. And through the residual coding process, information(e.g., syntax elements) efficiently indicating positions, sizes, signsor the like of the (quantized) transform coefficients may be generatedand signaled. The quantized transform coefficients may be simply calledtransform coefficients. Generally, in a case where the CB is not greaterthan a maximum TB, the size of the CB may be the same as that of the TB,and in this case, a target block to be transformed (and quantized) andresidual-coded may be called the CB or the TB. Meanwhile, in a casewhere the CB is greater than the maximum TB, the target block to betransformed (and quantized) and residual-coded may be called the TB.While, hereinafter, syntax elements related to residual coding aredescribed by way of example as being signaled in units of transformblocks (TBs), the TB and the coding block (CB) may be usedinterchangeably as described above.

In one embodiment, based on the syntax elements last_sig_coeff_x_prefix,last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, andlast_sig_coeff_y_suffix, the (x, y) position information of the lastnon-zero transform coefficient in the transform block may be encoded.More specifically, last_sig_coeff_x_prefix indicates a prefix of acolumn position of a last significant coefficient in a scanning order ina transform block; last_sig_coeff_y_prefix indicates a prefix of a rowposition of a last significant coefficient in the scanning order in thetransform block; last_sig_coeff_x_suffix indicates a suffix of a columnposition of a last significant coefficient in the scanning order in thetransform block; and last_sig_coeff_y_suffix indicates a suffix of a rowposition of a last significant coefficient in the scanning order in thetransform block. Here, the significant coefficient may be the non-zerocoefficient. The scanning order may be a right upward diagonal scanningorder. Alternatively, the scanning order may be a horizontal scanningorder, or a vertical scanning order. The scanning order may bedetermined based on whether or not the intra/inter prediction is appliedto a target block (CB, or CB including TB), and/or a specificintra/inter prediction mode.

Next, after dividing a transform block into 4×4 sub-blocks, a one-bitsyntax element for coded_sub_block_flag, may used for each 4×4 sub-blockto indicate whether or not there is a non-zero coefficient in a currentsub-block.

If the value of coded_sub_block_flag is 0, there is no more informationto be transmitted, and therefore, the encoding process for the currentsub-block may be terminated. Conversely, if the value ofcoded_sub_block_flag is 1, the encoding process for sig_coeff_flag maycontinue to be performed. Since the sub-block including the lastnon-zero coefficient does not require encoding of coded_sub_block_flag,and the sub-block including the DC information of the transform blockhas a high probability of including the non-zero coefficient,coded_sub_block_flag may be assumed to have a value of 1 without beingencoded.

If it is determined that a non-zero coefficient exists in the currentsub-block because the value of coded_sub_block_flag is 1, then,inversely, sig_coeff_flag having a binary value may be encoded accordingto the scan order. A 1-bit syntax element sig_coeff_flag may be encodedfor each coefficient according to the scan order. If the value of thetransform coefficient at the current scan position is not 0, the valueof sig_coeff_flag may be 1. Here, in the case of a sub-block includingthe last non-zero coefficient, since sig_coeff_flag is not required tobe encoded for the last non-zero coefficient, the encoding process forsig_coeff_flag may be omitted. Only when sig_coeff_flag is 1, levelinformation encoding may be performed, and four syntax elements may beused in the level information encoding process. More specifically, eachsig_coeff_flag[xC][yC] may indicate whether or not the level (value) ofthe corresponding transform coefficient at each transform coefficientposition (xC, yC) in the current TB is non-zero. In an embodiment, thesig_coeff_flag may correspond to an example of a significant coefficientflag indicating whether or not a quantized transform coefficient is anon-zero effective coefficient.

The level value remaining after the encoding for sig_coeff_flag may bethe same as in Equation 1 below. That is, the syntax element remAbsLevelindicating the level value to be encoded may be as shown in Equation 1below. Here, coeff means an actual transform coefficient value.remAbsLevel=|coeff|−1  [Equation 1]

Through par_level_flag, the least significant coefficient (LSB) value ofremAbsLevel written in Equation 1 may be encoded as shown in Equation 2below. Here, par_level_flag[n] may indicate a parity of a transformcoefficient level (value) at a scanning position n. After par_leve_flagencoding, a transform coefficient level value remAbsLevel to be encodedmay be updated as shown in Equation 3 below.par_level_flag=remAbsLevel & 1  [Equation 2]remAbsLevel′=remAbsLevel>>1  [Equation 3]

rem_abs_gt1_flag may indicate whether or not remAbsLevel′ at thecorresponding scanning position n is greater than 1, andrem_abs_gt2_flag may indicate whether or not remAbsLevel′ at thecorresponding scanning position n is greater than 2. Encoding forabs_remainder may be performed only when rem_abs_gt2_flag is 1. When therelationship between the actual transform coefficient value coeff andeach syntax element is summarized, it may be, for example, as inEquation 4 below, and Table 2 below shows examples related to Equation4. In addition, the sign of each coefficient may be encoded using a1-bit symbol coeff_sign_flag. |coeff| may indicate a transformcoefficient level (value), and may be expressed as AbsLevel for atransform coefficient.|coeff|=sig_coeff_flag+par_level_flag+2*(rem_abs_gt1_flag+rem_abs_gt2_flag+abs_remainder)  [Equation4]

TABLE 2 [coeff] sig_coeff_flag par_level_flag rem_abs_gt1_flagrem_abs_gt2_flag abs_remainder 0 0 1 1 0 0 2 1 1 0 3 1 0 1 0 4 1 1 1 0 51 0 1 1 0 6 1 1 1 1 0 7 1 0 1 1 1 8 1 1 1 1 1 9 1 0 1 1 2 10 1 1 1 1 211 1 0 1 1 3 ... ... ... ... ... ...

Meanwhile, in an embodiment, the par_level_flag indicates an example ofa parity level flag for parity of a transform coefficient level for thequantized transform coefficient, the rem_abs_gt1_flag indicates anexample of a first transform coefficient level flag related to whetheror not the transform coefficient level is greater than a first thresholdvalue, and the rem_abs_gt2_flag may indicate an example of a secondtransform coefficient level flag related to whether or not the transformcoefficient level is greater than a second threshold value.

In addition, in another embodiment, rem_abs_gt2_flag may be referred toas rem_abs_gt3_flag, and in another embodiment, rem_abs_gt1_flag andrem_abs_gt2_flag may be represented based on abs_level_gtx_flag[n][j].abs_level_gtx_flag[n][j] may be a flag indicating whether or not theabsolute value of the transform coefficient level at the scanningposition n (or the transform coefficient level shifted by 1 to theright) is greater than (j<<1)+1. In one example, the rem_abs_gt1_flagmay perform a function which is the same and/or similar function toabs_level_gtx_flag[n] [0], and the rem_abs_gt2_flag may perform afunction which is the same and/or similar to abs_level_gtx_flag[n][1].That is, the abs_level_gtx_flag[n][0] may correspond to an example ofthe first transform coefficient level flag, and theabs_level_gtx_flag[n][1] may correspond to an example of the secondtransform coefficient level flag. The (j<<1)+1 may be replaced by apredetermined threshold value, such as a first threshold value and asecond threshold value, according to circumstances.

FIG. 5 is a diagram illustrating an example of transform coefficients ina 4×4 block.

The 4×4 block of FIG. 5 shows an example of quantized coefficients. Theblock illustrated in FIG. 5 may be a 4×4 transform block, or a 4×4sub-block of an 8×8, 16×16, 32×32, or 64×64 transform block. The 4×4block of FIG. 5 may be a luminance block or a chrominance block. Theencoding result for the inverse diagonally scanned coefficients of FIG.5 may be, for example, shown in Table 3. In Table 3, scan_pos indicatesthe position of the coefficient according to the inverse diagonal scan.scan_pos 15 is a coefficient which is scanned first in the 4×4 block,that is, a coefficient at a bottom-right corner, and scan_pos 0 is acoefficient which is scanned last, that is, a coefficient at a top-leftcorner. Meanwhile, in one embodiment, the scan_pos may be referred to asa scan position. For example, the scan_pos 0 may be referred to as scanposition 0.

TABLE 3 scan_pos 15  14  13  12  11  10  9 8 7 6 5 4 3 2 1 0coefficients 0 0 0 0 1 −1   0 2 0 3 −2   −3   4 6 −7   10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 par_level_flag 0 0 1 0 10 1 1 0 1 rem_abs_gt1_flag 0 0 0 1 0 1 1 1 1 1 rem_abs_gt2_flag 0 0 0 11 1 abs_remainder 0 1 2 ceoff_sign_flag 0 1 0 0 1 1 0 0 1 0

As described in Table 1, in an embodiment, the main syntax element of a4×4 subblock unit may include sig_coeff_flag, par_level_flag,rem_abs_gt1_flag, rem_abs_gt2_flag, abs_remainder, coeff_sign_flag, andthe like. Among them, sig_coeff_flag, par_level_flag, rem_abs_gt1_flag,and rem_abs_gt2_flag may be context-encoded bins encoded using a regularencoding engine, and abs_remainder and coeff sign_flag may be bypassbins encoded using the bypass encoding engine.

The context-encoded bin may indicate high data dependence because ituses the updated probability state and range while processing theprevious bin. That is, since the context-encoded bin can performencoding/decoding of the next bin after all encoding/decoding of thecurrent bin is performed, it may be difficult to be parallel processed.In addition, it may take a lot of time to read the probability intervaland determine the current state. Accordingly, in an embodiment, a methodof improving CABAC throughput by reducing the number of context-encodedbins and increasing the number of bypass bins is proposed.

In an embodiment, coefficient level information may be encoded in aninverse scan order. That is, beginning with the coefficients at thebottom right of the unit block, it may be scanned and then encoded inthe top left direction. In an example, the coefficient level scannedfirst in the inverse scan order may indicate a small value. Signalingpar_level_flag, rem_abs_gt1_flag, and rem_abs_gt2_flag for thecoefficients that are scanned first may reduce the length ofbinarization bins for indicating the coefficient level, and each syntaxelement may be efficiently encoded through arithmetic coding based on apreviously encoded context using a predetermined context.

However, in the case of some coefficient levels having large values,that is, coefficient levels located at the top left of the unit block,signaling par_level_flag, rem_abs_gt1_flag, and rem_abs_gt2_flag may nothelp to improve compression performance Using par_level_flag,rem_abs_gt1_flag, and rem_abs_gt2_flag may rather lower encodingefficiency.

In one embodiment, by quickly switching the syntax elements(par_level_flag, rem_abs_gt1_flag, rem_abs_gt2_flag) encoded ascontext-encoded bins to the abs_remainder syntax elements encoded usingthe bypass encoding engine, that is, encoded as bypass bins, it ispossible to reduce the number of context-encoded bins.

That is, according to embodiments of the present disclosure, the numberof context-encoded bins may be limited, and when the number ofcontext-encoded bins coded according to the (inverse) scan order withinone sub-block reaches a limited value, then context encoding may beskipped for at least one of sig_coeff_flag, par_level_flag,rem_abs_gt1_flag and/or rem_abs_gt2_flag for the (current) quantizedtransform coefficient. In this case, the value of the quantizedtransform coefficient processed in the syntax element for which thecontext encoding is skipped may be included in the abs_remainder syntaxelement, and bypass-based coded. Through this, the throughput inresidual coding may be improved. In the present disclosure, the numberof context-encoded bins may be limited in units of sub-blocks within atransform block (TB) or a transform unit (TU), or limited in units oftransform blocks (TBs) or transform units (TUs) including sub-blocks.

In an embodiment, the number of coefficients encoded withrem_abs_gt2_flag may be limited. The maximum number of explicitlyencoded rem_abs_gt2_flag in a 4×4 block may be 16. That is,rem_abs_gt2_flag may be encoded for all coefficients whose absolutevalue is greater than 2, according to an embodiment, for the first Ncoefficients having an absolute value greater than 2 (ie, coefficientswith rem_abs_gt1_flag which is equal to 1) according to the scan order,rem_abs_gt2_flag can be only coded. N may be selected by the encodingapparatus or may be set to an arbitrary value from 0 to 16. Table 4shows an example of the above embodiment when N is 1. According to anembodiment, in a 4×4 block, the encoding number of rem_abs_gt2_flag maybe reduced by the number indicated by X in Table 4 below, and thus thenumber of context-encoded bins may be reduced. When compared with Table3, the value of abs_remainder of coefficients for scan positions whereencoding for rem_abs_gt2_flag is not performed may be changed as shownin Table 4 below.

TABLE 4 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 0 1 0 1 1 0  1 rem_abs_gt1_flag 0 0 01 0 1 1 1 1  1 rem_abs_gt2_flag 0 X X X X X abs_remainder 0 0 1 2  3coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In an embodiment, the number of coefficients encoded withrem_abs_gt1_flag may be limited. The number of explicitly encodedrem_abs_gt2_flag in a 4×4 block may be up to 16. That is,rem_abs_gt1_flag may be encoded for all coefficients whose absolutevalue is greater than 0, according to one embodiment, for the first Mcoefficients having an absolute value greater than 0 (i.e., coefficientswith sig_coeff_flag which is equal to 1) according to the scan order,rem_abs_gt1_flag can be encoded. M may be selected by the encodingapparatus or may be set to an arbitrary value from 0 to 16. Table 5shows an example of the above embodiment when M is 4. Ifrem_abs_gt1_flag is not encoded, rem_abs_gt2_flag is also not encoded,so according to the embodiment, the number of encodings forrem_abs_gt1_flag and rem_abs_gt2_flag can be reduced by the numberindicated by X in the 4×4 block, and thus the number of context-encodedbins can be reduced. When compared with Table 3, values ofrem_abs_gt2_flag and abs_remainder of coefficients for scan positionswhere encoding for rem_abs_gt1_flag is not performed may be changed asshown in Table 6 below. Table 6 shows an applicable example of theembodiment when M is 8.

TABLE 5 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 0 1 0 1 1 0  1 rem_abs_gt1_flag 0 0 01 X X X X X X rem_abs_gt2_flag 0 X X X X X abs_remainder 0 1 1 2 3  4coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

TABLE 6 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 0 1 0 1 1 0  1 rem_abs_gt1_flag 0 0 01 0 1 1 1 X X rem_abs_gt2_flag 0 0 0 1 X X abs_remainder 0 3  4coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In one embodiment, the above-described embodiments respectively limitingthe number of rem_abs_gt1_flag and rem_abs_gt2_flag, may be combined.Both M indicating the limit on the number of rem_abs_gt1_flag and Nindicating the limit on the number of rem_abs_gt2_flag may have valuesfrom 0 to 16, but N may be the same as M or less than N. Table 7 showsan example of this embodiment when M is 8 and N is 1. Since encoding ofthe corresponding syntax element is not performed at positions markedwith X, the number of context-coded bins can be reduced.

TABLE 7 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 0 1 0 1 1 0  1 rem_abs_gt1_flag 0 0 01 0 1 1 1 X X rem_abs_gt2_flag 0 X X X X X abs_remainder 0 0 1 3  4coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In an embodiment, the number of coefficients encoded with par_level_flagmay be limited. The number of explicitly encoded par_level_flags in the4×4 block may be a maximum of 16. That is, par_level_flag may be encodedfor all coefficients whose absolute value is greater than 0. In oneembodiment, for only the first L coefficients having an absolute valuegreater than 0 according to the scan order (that is, a coefficient withsig_coeff_flag equal to 1), par_level_flag can be coded. L may beselected by the encoding apparatus or may be set to an arbitrary valuefrom 0 to 16. Table 8 shows an application example of the embodimentwhen L is 8. According to the above embodiment, the number of encodingsfor par_level_flag may be reduced by the number indicated by X in the4×4 block, and thus, the number of context-coded bins may be reduced.When compared with Table 3, values of rem_abs_gt1_flag,rem_abs_gt2_flag, and abs_remainder of coefficients for scan positionswhere encoding for par_level_flag is not performed may be changed asshown in Table 8 below.

TABLE 8 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 0 1 0 1 1 X X rem_abs_gt1_flag 0 0 0 10 1 1 1 1  1 rem_abs_gt2_flag 0 0 0 1 1  1 abs_remainder 0 4  7coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In one embodiment, the above-described embodiments, each limiting thenumber of par_level_flag and rem_abs_gt2_flag, may be combined. Both Lindicating the limit on the number of par_level_flag and N indicatingthe limit on the number of rem_abs_gt2_flag may have values from 0 to16. Table 9 shows an application example of this embodiment when L is 8and N is 1. Since encoding of a corresponding syntax element is notperformed at positions marked with X, the number of context-encoded binscan be reduced.

TABLE 9 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 0 1 0 1 1 X X rem_abs_gt1_flag 0 0 0 10 1 1 1 1  1 rem_abs_gt2_flag 0 X X X X X abs_remainder 0 0 1 5  8coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In one embodiment, the above-described embodiments, each limiting thenumber of par_level_flag and rem_abs_gt1_flag, may be combined. Both Lindicating the limit on the number of par_level_flag and M indicatingthe limit on the number of rem_abs_gt1_flag may have values from 0 to16. Table 10 shows an application example of this embodiment when L is 8and M is 8. Since encoding of a corresponding syntax element is notperformed at positions marked with X, the number of context-encoded binscan be reduced.

TABLE 10 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 0 1 0 1 1 X X rem_abs_gt1_flag 0 0 0 10 1 1 1 X X rem_abs_gt2_flag 0 0 0 1 X X abs_remainder 0 6  9coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In one embodiment, the above-described embodiments, each limiting thenumber of par_level_flag, rem_abs_gt1_flag, and rem_abs_gt2_flag, may becombined. L indicating the limit on the number of par_level_flag, Mindicating the limit on the number of rem_abs_gt1_flag, and N indicatingthe limit on the number of rem_abs_gt2_flag may all have values from 0to 16, but N may be the same as M or smaller than M. Table 11 shows anapplication example of this embodiment when L is 8, M is 8, and N is 1.Since encoding of a corresponding syntax element is not performed atpositions marked with X, the number of context-encoded bins can bereduced.

TABLE 11 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 0 1 0 1 1 X X rem_abs_gt1_flag 0 0 0 10 1 1 1 X X rem_abs_gt2_flag 0 X X X X X abs_remainder 0 0 1 6  9coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In one embodiment, a method of limiting the sum of the numbers ofsig_coeff_flag, par_level_flag, and rem_abs_gt1_flag may be proposed.Assuming that the sum of the numbers of sig_coeff_flag, par_level_flag,and rem_abs_gt1_flag is limited to K, K may have a value from 0 to 48.In the present embodiment, when the sum of the numbers ofsig_coeff_flag, par_level_flag, and rem_abs_gt1_flag exceeds K andsig_coeff_flag, par_level_flag, and rem_abs_gt1_flag are not encoded,rem_abs_gt2_flag may not be encoded. Table 12 shows the case where K islimited to 30.

TABLE 12 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 X X par_level_flag 0 0 1 0 1 0 1 1 X X rem_abs_gt1_flag 0 0 0 10 1 1 1 X X rem_abs_gt2_flag 0 0 0 1 X X abs_remainder 0 7 10coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In an embodiment, a method of limiting the sum of the numbers ofsig_coeff_flag, par_level_flag, and rem_abs_gt1_flag may be combinedwith a method of limiting the number of rem_abs_gt2_flag describedabove. Assuming that the sum of the numbers of sig_coeff_flag,par_level_flag, and rem_abs_gt1_flag is limited to K and the number ofrem_abs_gt2_flag is limited to N, K may have a value from 0 to 48, and Nmay have a value from 0 to 16. Table 13 shows the case where K islimited to 30 and N is limited to 2.

TABLE 13 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 X X par_level_flag 0 0 1 0 1 0 1 1 X X rem_abs_gt1_flag 0 0 0 10 1 1 1 X X rem_abs_gt2_flag 0 0 X X X X abs_remainder 0 1 7 10coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In an embodiment, encoding may be performed in the order ofpar_level_flag and rem_abs_gt1_flag, but in this embodiment, encodingmay be performed in the order of rem_abs_gt1_flag and par_level_flag bychanging the encoding order. If the encoding order of par_level_flag andrem_abs_gt1_flag is changed in this way, rem_abs_gt1_flag is encodedafter sig_coeff_flag is encoded, and par_level_flag can be encoded onlywhen rem_abs_gt1_flag is 1. Accordingly, the relationship between theactual transform coefficient value coeff and each of syntax elements maybe changed as shown in Equation 5 below. Table 14 below shows an exampleof a case in which the encoding order of par_level_flag andrem_abs_gt1_flag is changed. Compared with Table 2, in Table 14 below,par_level_flag is not encoded when |coeff| is 1, so there may be anadvantage aspect of throughput and encoding. Of course, in Table 14,when |coeff| is 2, unlike Table 2, rem_abs_gt2_flag should be encodedand when |coeff| is 4, abs_remainder should be encoded unlike Table 2.But because |coeff| equals 1 can occur more often than |coeff| equals 2or 4, when according to Table 14 higher throughput and encodingperformance may be exhibited compared to Table 2. The result of encodingthe 4×4 sub-block in FIG. 5 may be shown in Table 15 below.|coeff|=sig_coeff_flag+rem_abs_gt1_flag+par_level_flag+2*(rem_abs_gt2_flag+abs_remainder)  [Equation5]

TABLE 14 |coeff| sig_coeff_flag rem_abs_gt1_flag par_level_flagrem_abs_gt2_flag abs_remainder 0 0 1 1 0 2 1 1 0 0 3 1 1 1 0 4 1 1 0 1 05 1 1 1 1 0 6 1 1 0 1 1 7 1 1 1 1 1 8 1 1 0 1 2 9 1 1 1 1 2 10 1 1 0 1 311 1 1 1 1 3 ... ... ... ... ... ...

TABLE 15 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 1 1 1 1 1 1  1 rem_abs_gt1_flag 0 1 01 0 0 1  0 rem_abs_gt2_flag 0 0 0 0 1 1 1  1 abs_remainder 0 1 1  3coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In one embodiment, the encoding order of par_level_flag andrem_abs_gt1_flag is changed, thus when the encoding is performed in theorder of sig_coeff_flag, rem_abs_gt1_flag, par_level_flag,rem_abs_gt2_flag, abs_remainder, coeff_sign_flag, a method of limitingthe sum of the numbers of sig_coeff_flag, rem_abs_gt1_flagpar_level_flag may be proposed. That is, in this embodiment, by changingthe encoding order, encoding may be performed in the order ofrem_abs_gt1_flag and par_level_flag, and when the sum of the numbers ofsig_coeff_flag, rem_abs_gt1_flag and par_level_flag is limited to K, Kmay have a value from 0 to 48. In this embodiment, when sig_coeff_flag,rem_abs_gt1_flag, and par_level_flag are no longer coded,rem_abs_gt2_flag may also not be coded. Table 16 shows the case where Kis limited to 25.

TABLE 16 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 X X X par_level_flag 0 0 1 1 1 1 1 X X X rem_abs_gt1_flag 0 1 0 10 X X X rem_abs_gt2_flag 0 0 0 0 1 X X X abs_remainder 0 6 7 10coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In an embodiment, sig_coeff_flag, rem_abs_gt1_flag, and par_level_flagmay be encoded in one ‘for loop’ in the (residual) syntax. The codingcan be stopped at the same scan position even if the sum of the numbersof three syntax elements (sig_coeff_flag, rem_abs_gt1_flag, andpar_level_flag) does not exceed K and the sum of the three syntaxelements is not exactly K. Table 17 below shows a case where K islimited to 27. When encoding is performed up to scan position 3, the sumof the numbers of sig_coeff_flag, rem_abs_gt1_flag, and par_level_flagis 25. While it is a value that does not exceed K, because the encodingapparatus at this time does not know the value of the coefficient levelof scan_pos 2, it is not known which value from 1 to 3 the number ofcontext-encoded bins in scan_pos 2 will be. Accordingly, the encodingapparatus may encode up to scan_pos 3 and terminate the encoding.Although the K value is different, the encoding result may be the samein Table 16 and Table 17 below.

TABLE 17 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 X X X par_level_flag 0 0 1 1 1 1 1 X X X rem_abs_gt1_flag 0 1 0 10 X X X rem_abs_gt2_flag 0 0 0 0 1 X X X abs_remainder 0 6 7 10coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In one embodiment, a method of changing the encoding order ofpar_level_flag and rem_abs_gt1_flag, and limiting the number ofrem_abs_gt2_flag may be proposed. That is, encoding is performed in theorder of sig_coeff_flag, rem_abs_gt1_flag, par_level_flag,rem_abs_gt2_flag, abs_remainder, coeff_sign_flag, and the number ofcoefficients encoded with rem_abs_gt2_flag may be limited.

The maximum number of rem_abs_gt2_flag explicitly encoded in the 4×4block is 16. That is, rem_abs_gt2_flag may be encoded for allcoefficients having an absolute value greater than 2. In contrast, inthe present embodiment, rem_abs_gt2_flag may be encoded only for thefirst N coefficients having an absolute value greater than 2 (ie,coefficients having rem_abs_gt1_flag equal to 1) according to the scanorder. N may be selectable by the encoding apparatus, or may be set toan arbitrary value from 0 to 16. Table 18 below shows an example ofapplication of this embodiment when N is 1. In the 4×4 block, the numberof encodings for rem_abs_gt2_flag can be reduced by the number indicatedby X, and thus the number of context-encoded bins can be reduced. Thevalue of abs_remainder of coefficients for scan positions where encodingfor rem_abs_gt2_flag is not performed may be changed as shown in Table18 below compared to Table 15.

TABLE 18 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 1 1  1 par_level_flag 0 0 1 1 1 1 1 1 1  1 rem_abs_gt1_flag 0 1 01 0 0 1  0 rem_abs_gt2_flag 0 0 0 0 1 1 1  1 abs_remainder 0 1 1  3coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

In an embodiment, a method of changing the encoding order ofpar_level_flag and rem_abs_gt1_flag, and limiting the sum of the numbersof sig_coeff_flag, rem_abs_gt1_flag, and par_level_flag and the numberof rem_abs_gt2_flag, respectively, may be proposed. In one example, whenencoding is performed in the order of sig_coeff_flag, rem_abs_gt1_flag,par_level_flag, rem_abs_gt2_flag, abs_remainder, coeff_sign_flag, themethod of limiting the sum of the numbers of sig_coeff_flag, rem_abs_gt1and par_level_flag, and the method of limiting the number ofrem_abs_gt1_gt2 above-described may be combined. Assuming that the sumof the numbers of sig_coeff_flag, rem_abs_gt1_flag, and par_level_flagis limited to K and the number of rem_abs_gt2_flag is limited to N, Kmay have a value from 0 to 48, and N may have a value from 0 to 16.Table 19 shows a case where K is limited to 25 and N is limited to 2.

TABLE 19 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1  0 2 0 3 −2  −3  4 6 −7  10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 11 1 1 X X X par_level_flag 0 0 1 1 1 1 1 X X X rem_abs_gt1_flag 0 1 0 10 X X X rem_abs_gt2_flag 0 0 X X X X X X abs_remainder 0 0 1 6 7 10coeff_sign_flag 0 1 0 0 1 1 0 0 1  0

Hereinafter, a method of controlling the number of context-encoded binsin units of transform blocks

Transform coefficient information in a transform block may be encoded inunits of 4×4 or 2×2 sub-blocks. In this embodiment, the number ofcontext-encoded bins is controlled in units of not sub-blocks, buttransform blocks. As described above, the context-encoded syntax elementmay include at least one of said sig_coeff_flag, par_level_flag,rem_abs_gt1_flag, and/or rem_abs_gt2_flag. In addition, hereinafter, thecontext-encoded bin may indicate a context-encoded bin for at least oneof said sig_coeff_flag, par_level_flag, rem_abs_gt1_flag, and/orrem_abs_gt2_flag.

FIG. 6 is a control flowchart illustrating a residual coding methodaccording to an example of the present disclosure.

In FIG. 6, NumSblkRegBin may mean a threshold value that controls themaximum number of context-encoded bins that can be used in onesub-block. Accordingly, NumSblkRegBin may have a value from 0 to (thenumber of pixels included in the sub-block×the number of syntax elementsencoded in the context-encoded bin), and is not limited to a specificvalue in the present embodiment.

For example, the maximum number of context-encoded bins indicated byNumSblkRegBin may limit the number of context-coded bins for all ofsig_coeff_flag, par_level_flag, rem_abs_gt1_flag and rem_abs_gt2_flag.As another example, the maximum number of context-encoded bins indicatedby NumSblkRegBin may limit the number of context-coded bins for some ofthe syntax elements sig_coeff_flag, par_level_flag, rem_abs_gt1_flag,and rem_abs_gt2_flag.

When the number of context-encoded bins encoded in one sub-blockencoding is less than the predetermined NumSblkRegBin, NumSblkRegBin fornext sub-block encoding may be increased by the difference value.Through this, if necessary, the restriction on the number ofcontext-encoded bins in the next sub-block encoding can be alleviate.

According to the present embodiment, since the characteristics of thetransform coefficients in each sub-block are reflected and a variableNumSblkRegBin can be applied for each sub-block, compared to a techniquefor limiting the number of context-encoded bins in units of onlysub-blocks, the number of context encoding bins may be more limited, andencoding performance may not be significantly degraded.

That is, according to the present embodiment, the maximum number ofcontext-encoded bins is limited to a threshold value, but the number ofcontext-encoded bins saved in a block having many (quantized) transformcoefficients having a zero value, such as a right or lower subblock, maybe reflected in the next subblock. Therefore, a relatively large numberof context encodings can be performed in sub-blocks located at the upperleft and neighboring of the upper left (low frequency region).

Through this, it is possible to maintain the number of the contextencoding performed in the overall transform blocks, and improve theoverall throughput while adaptively improving the coding gain in the lowfrequency region of the transform block.

NumSblkRegBin may have the same value in the entire encoding, or mayhave various values according to the size of a transform block.Moreover, NumSblkRegBin may be determined by the encoding apparatus andsignaled to the decoding apparatus. In addition, when a technique forlimiting the number of context-encoded bins in units of sub-blocks isapplied, the number of NumSblkRegBin may be limited to a value equal toor smaller than the limit value of the number of context-encoded binslimited by the technology.

Referring to FIG. 6, the control method according to the presentembodiment is summarized as follows.

First, the maximum number of context-encoded bins (NumSblkRegBin) thatcan be used in one sub-block is set (S600).

Then, a coder loads the first sub-block, that is, the first sub-blockdata (S610), and encodes the sub-block based on NumSblkRegBin (S620).

Thereafter, a value obtained by subtracting the number of encodedcontext-encoded bins from NumSblkRegBin is updated to NumSblkRegBin forthe next subblock (S630).

In this way, all sub-blocks in the transform block can be coded in acertain coding direction.

If it is not the last sub-block (S640), data of the next sub-block isuploaded (S650), and the uploaded sub-block may be encoded based onNumSblkRegBin.

FIG. 7 is a flowchart showing operation of an encoding apparatusaccording to an embodiment, and FIG. 8 is a block diagram showingconfiguration of an encoding apparatus according to an embodiment.

The encoding apparatus according to FIGS. 7 and 8 may perform operationscorresponding to those of a decoding apparatus according to FIGS. 9 and10. Therefore, operations of the decoding apparatus to be describedlater in FIGS. 9 and 10 may be similarly applied to the encodingapparatus according to FIGS. 7 and 8.

Each step disclosed in FIG. 7 may be performed by the encoding apparatus200 disclosed in FIG. 2. More specifically, S700 may be performed by thesubtractor 231 disclosed in FIG. 2, S710 may be performed by thequantizer 233 disclosed in FIG. 2, and S720 may be performed by theentropy encoder 240 disclosed in FIG. 2. Further, operations accordingto S700 to S720 are based on some of contents described above in FIGS. 4to 6. Therefore, an explanation for the specific contents redundant withthose described above in FIGS. 2, and 4 to 6 will be omitted or madebriefly.

As shown in FIG. 8, the encoding apparatus according to an embodimentmay include the subtractor 231, the transformer 232, the quantizer 233,and the entropy encoder 240. However, in some cases, all of thecomponents shown in FIG. 8 may not be necessarily essential to theencoding apparatus, and the encoding apparatus may be implemented bymore or less components than those shown in FIG. 8.

In the encoding apparatus according to an embodiment, each of thesubtractor 231, the transformer 232, the quantizer 233, and the entropyencoder 240 may be embodied by a separate chip, or at least two or morecomponents may be embodied through a single chip.

The encoding apparatus according to an embodiment may derive a residualsample for a current block (S700). More specifically, the subtractor 231of the encoding apparatus may derive a residual sample for a currentblock.

The encoding apparatus according to an embodiment may derive a quantizedtransform coefficient based on the residual sample for the current block(S710). More specifically, the quantizer 233 of the encoding apparatusmay derive a quantized transform coefficient based on the residualsample for the current block.

The encoding apparatus according to an embodiment may encode residualinformation including information on the quantized transform coefficient(S720). More specifically, the entropy encoder 240 of the encodingapparatus may encode residual information including information on thequantized transform coefficient.

In one embodiment, the residual information may include a parity levelflag for a parity of a transform coefficient level for the quantizedtransform coefficient and a first transform coefficient level flagrelated to whether or not the transform coefficient level is greaterthan a first threshold value. In one example, the parity level flag mayindicate par_level_flag, the first transform coefficient level flag mayindicate rem_abs_gt1_flag or abs_level_gtx_flag[n] [0], and the secondtransform coefficient level flag may indicate rem_abs_gt2_flag, orabs_level_gtx_flag [n] [1].

In an embodiment, the encoding the residual information includesderiving a value of the parity level flag and a value of the firsttransform coefficient level flag based on the quantized transformcoefficient, and encoding the first transform coefficient level flag andencoding the parity level flag.

In an embodiment, the encoding the first transform coefficient levelflag may be performed prior to the encoding the parity level flag. Forexample, the encoding apparatus may perform encoding forrem_abs_gt1_flag or abs_level_gtx_flag[n][0] prior to encoding forpar_level_flag.

In an embodiment, the residual information may further include asignificant coefficient flag indicating whether or not the quantizedtransform coefficient is a non-zero significant coefficient, and asecond transform coefficient level flag related to whether or not thetransform coefficient level for the quantized transform coefficient isgreater than a second threshold value. In one example, the significantcoefficient flag may indicate sig_coeff_flag.

The residual information may include a context-based coded contextsyntax element, and the context syntax element may include thesignificant coefficient flag, the parity level flag, the first transformcoefficient level flag, and the second transform coefficient level flag.

In an embodiment, the deriving the quantized transform coefficient maycontext-based encode the context syntax element based on a predeterminedmaximum value for the context syntax element.

In other words, the sum of the number of the significant coefficientflags for quantized transform coefficients within the current block, thenumber of the first transform coefficient level flags, the number of theparity level flags, and the number of the second transform coefficientlevel flags included in the residual information may be less than orequal to a predetermined maximum value.

This maximum value may be the maximum value of the sum of the number ofthe significant coefficient flags for the quantized transformcoefficients related to the current sub-block within the current block,the number of the first transform coefficient level flags, the number ofthe parity level flags, and the number of the second transformcoefficient level flags.

In an embodiment, the maximum value may be determined in units oftransform blocks. The current block may be a sub-block within atransform block, which is a transform unit, encoding of a quantizedtransform coefficient is performed in units of sub-blocks, and a contextsyntax element among residual information may be encoded based on amaximum value determined in units of transform blocks at the time ofencoding of a quantized transform coefficient in units of sub-blocks.

In an embodiment, this threshold value may be determined based on thesize of the current block (or a current sub-block within the currentblock). If the current block is a transform block, the threshold valuemay be determined based on the size of the transform block.

According to another embodiment, the current block may be a sub-blockwithin a transform block, and the threshold value may be controlled inunits of sub-blocks. For example, at the time of coding a sub-block, anallowable threshold value may be determined, and when encoding a contextsyntax element, a context syntax element may be encoded according to athreshold value corresponding to the sub-block.

In an embodiment, when the sum of the number of the significantcoefficient flags, the number of the first transform coefficient levelflags, the number of the parity level flags, and the number of thesecond transform coefficient level flags derived based on a 0thquantized transform coefficient to an nth quantized transformcoefficient determined by a coefficient scan order reaches thepredetermined maximum value, then explicit signaling of a significantcoefficient flag, a first transform coefficient level flag, a paritylevel flag, and a second transform coefficient level flag may be omittedfor a (n+1)th quantized transform coefficient determined by thecoefficient scan order, and a value of the (n+1)th quantized transformcoefficient may be derived based on a value of coefficient levelinformation included in the residual information.

For example, when the sum of the number of sig_coeff_flag, the number ofrem_abs_gt1_flag (or abs_level_gtx_flag[n][0]), the number ofpar_level_flags, and the number of rem_abs_gt2_flag (orabs_level_gtx_flag[n][1]) derived based on the 0th quantized transformcoefficient (or the first quantized transform coefficient) to the nthquantized transform coefficient (or the nth quantized transformcoefficient) determined by the coefficient scan order reaches thepredetermined maximum value, then explicit signaling of sig_coeff_flag,rem_abs_gt1_flag (or abs_level_gtx_flag[n][0]), par_level_flag,abs_level_gtx_flag[n][1] and rem_abs_gt2_flag (orabs_level_gtx_flag[n][1]) may be omitted for a (n+1)th quantizedtransform coefficient determined by the coefficient scan order, and avalue of the (n+1)th quantized transform coefficient may be derivedbased on the value of abs_remainder or dec_abs_level included in theresidual information.

In an embodiment, the significant coefficient flags, the first transformcoefficient level flags, the parity level flags, and the secondtransform coefficient level flags included in the residual informationmay be context-based coded, and the coefficient level information may bebypass-based coded.

According to the encoding apparatus and the operation method of theencoding apparatus of FIGS. 7 and 8, the encoding apparatus derives aresidual sample for the current block (S700), derives a quantizedtransform coefficient based on the residual sample for the current block(S710), and encodes residual information including information on thequantized transform coefficient (S720), wherein the residual informationincludes a parity level flag for parity of a transform coefficient levelfor the quantized transform coefficient, and a first transformcoefficient level flag related to whether or not the transformcoefficient level is greater than a first threshold value, and theencoding the residual information includes deriving a value of theparity level flag and a value of the first transform coefficient levelflag based on the quantized transform coefficient, and encoding thefirst transform coefficient level flag, and the encoding of the firsttransform coefficient level flag is performed prior to the encoding ofthe parity level flag. That is, according to the present disclosure, bydetermining (or changing) the decoding order of the parity level flagfor the parity of the transform coefficient level for the quantizedtransform coefficient, and the first transform coefficient level flagrelated to whether or not the transform coefficient level is greaterthan the first threshold value, coding efficiency can be improved.

FIG. 9 is a flowchart showing operation of a decoding apparatusaccording to an example, and FIG. 10 is a block diagram showingconfiguration of an decoding apparatus according to an example.

Each of steps disclosed in FIG. 9 may be performed by the decodingapparatus 300 disclosed in FIG. 3. More specifically, S900 and S910 maybe performed by the entropy decoder 310 disclosed in FIG. 3, S920 may beperformed by the dequantizer 321 and/or the inverse transformer 322disclosed in FIG. 3, and S930 may be performed by the adder 340disclosed in FIG. 3. In addition, operations according to S900 to S930are based on some of contents described above with reference to FIGS. 4to 8. Therefore, an explanation for the specific contents redundant withthose described above in FIGS. 3 to 6 will be omitted or made briefly.

As shown in FIG. 10, the decoding apparatus according to an embodimentmay include the entropy decoder 310, the dequantizer 321, the inversetransformer 322, and the adder 340. However, in some cases, all of thecomponents shown in FIG. 10 may not be necessarily essential to thedecoding apparatus, and the decoding apparatus may be implemented bymore or less components than those shown in FIG. 10.

In the decoding apparatus according to an embodiment, each of theentropy decoder 310, the dequantizer 321, the inverse transformer 322,and the adder 340 may be embodied by a separate chip, or at least two ormore components may be embodied through a single chip.

The decoding apparatus according to an embodiment may receive abitstream including residual information (S900). More specifically, theentropy decoder 310 of the decoding apparatus may receive a bitstreamincluding residual information.

The decoding apparatus according to an embodiment may derive a quantizedtransform coefficient for a current block based on the residualinformation included in a bitstream (S910). More specifically, theentropy decoder 310 of the decoding apparatus may derive the quantizedtransform coefficient for the current block based on the residualinformation included in the bitstream.

The decoding apparatus according to an embodiment may derive a residualsample for the current block based on the quantized transformcoefficient (S920). More specifically, the dequantizer 321 of thedecoding apparatus may derive the transform coefficient from thequantized transform coefficient based on the dequantization process, andthe inverse transformer 322 of the decoding apparatus may inversetransform the transform coefficient, and derive the residual sample forthe current block.

The decoding apparatus according to an embodiment may generate areconstructed picture based on the residual sample for the current block(S930). More specifically, the adder 340 of the decoding apparatus maygenerate the reconstructed picture based on the residual sample for thecurrent block.

In one embodiment, the residual information may include a parity levelflag for a parity of a transform coefficient level for the quantizedtransform coefficient and a first transform coefficient level flagrelated to whether or not the transform coefficient level is greaterthan a first threshold value. In one example, the parity level flag mayindicate par_level_flag, the first transform coefficient level flag mayindicate rem_abs_gt1_flag or abs_level_gtx_flag[n][0], and the secondtransform coefficient level flag may indicate rem_abs_gt2_flag, orabs_level_gtx_flag[n][1].

In an embodiment, the deriving the residual information includesderiving a value of the parity level flag and a value of the firsttransform coefficient level flag based on the quantized transformcoefficient, and encoding the first transform coefficient level flag anddecoding the parity level flag.

In an embodiment, the decoding the first transform coefficient levelflag may be performed prior to the decoding the parity level flag. Forexample, the decoding apparatus may perform decoding forrem_abs_gt1_flag or abs_level_gtx_flag[n][0] prior to decoding forpar_level_flag.

In an embodiment, the residual information may further include asignificant coefficient flag indicating whether or not the quantizedtransform coefficient is a non-zero significant coefficient, and asecond transform coefficient level flag related to whether or not thetransform coefficient level for the quantized transform coefficient isgreater than a second threshold value. In one example, the significantcoefficient flag may indicate sig_coeff_flag.

The residual information may include a context-based coded contextsyntax element, and the context syntax element may include thesignificant coefficient flag, the parity level flag, the first transformcoefficient level flag, and the second transform coefficient level flag.

In an embodiment, the deriving the quantized transform coefficient maycontext-based decode the context syntax element based on a predeterminedmaximum value for the context syntax element.

In other words, the sum of the number of the significant coefficientflags for quantized transform coefficients within the current block, thenumber of the first transform coefficient level flags, the number of theparity level flags, and the number of the second transform coefficientlevel flags included in the residual information may be less than orequal to a predetermined maximum value.

This maximum value may be the maximum value of the sum of the number ofthe significant coefficient flags for the quantized transformcoefficients related to the current sub-block within the current block,the number of the first transform coefficient level flags, the number ofthe parity level flags, and the number of the second transformcoefficient level flags.

In an embodiment, the maximum value may be determined in units oftransform blocks. The current block may be a sub-block within atransform block, which is a transform unit, encoding of a quantizedtransform coefficient may be performed in units of sub-blocks, and acontext syntax element among residual information may be decoded basedon a maximum value determined in units of transform blocks at the timeof encoding of a quantized transform coefficient in units of sub-blocks.

In an embodiment, this threshold value may be determined based on thesize of the current block (or a current sub-block within the currentblock). If the current block is a transform block, the threshold valuemay be determined based on the size of the transform block.

According to another embodiment, the current block may be a sub-blockwithin a transform block, and the threshold value may be controlled inunits of sub-blocks. For example, at the time of decoding a sub-block,an allowable threshold value may be determined, and when decoding acontext syntax element, a context syntax element may be decodedaccording to a threshold value corresponding to the sub-block.

In an embodiment, when the sum of the number of the significantcoefficient flags, the number of the first transform coefficient levelflags, the number of the parity level flags, and the number of thesecond transform coefficient level flags derived based on a 0thquantized transform coefficient to an nth quantized transformcoefficient determined by a coefficient scan order reaches thepredetermined maximum value, then explicit signaling of a significantcoefficient flag, a first transform coefficient level flag, a paritylevel flag, and a second transform coefficient level flag may be omittedfor a (n+1)th quantized transform coefficient determined by thecoefficient scan order, and a value of the (n+1)th quantized transformcoefficient may be derived based on a value of coefficient levelinformation included in the residual information.

For example, when the sum of the number of sig_coeff_flag, the number ofrem_abs_gt1_flag (or abs_level_gtx_flag[n][0]), the number ofpar_level_flags, and the number of rem_abs_gt2_flag (orabs_level_gtx_flag[n][1]) derived based on the 0th quantized transformcoefficient (or the first quantized transform coefficient) to the nthquantized transform coefficient (or the nth quantized transformcoefficient) determined by the coefficient scan order reaches thepredetermined maximum value, then explicit signaling of sig_coeff_flag,rem_abs_gt1_flag (or abs_level_gtx_flag[n][0]), par_level_flag,abs_level_gtx_flag[n][1] and rem_abs_gt2_flag (orabs_level_gtx_flag[n][1]) may be omitted for a (n+1)th quantizedtransform coefficient determined by the coefficient scan order, and avalue of the (n+1)th quantized transform coefficient may be derivedbased on the value of abs_remainder or dec_abs_level included in theresidual information.

In an embodiment, the significant coefficient flags, the first transformcoefficient level flags, the parity level flags, and the secondtransform coefficient level flags included in the residual informationmay be context-based coded, and the coefficient level information may bebypass-based coded.

According to the decoding apparatus and the operation method of thedecoding apparatus shown in FIGS. 9 and 10, the decoding apparatusreceives a bitstream including residual information (S900), derivesquantized transform coefficients for the current block based on theresidual information included in the bitstream (S910), derives aresidual sample for the current block based on the quantized transformcoefficient (S920), and generates a reconstructed picture based on theresidual sample for the current block (S930), wherein the residualinformation includes a parity level flag for parity of a transformcoefficient level for the quantized transform coefficient, and a firsttransform coefficient level flag related to whether or not the transformcoefficient level is greater than a first threshold value, and Thederiving the quantized transform coefficient includes decoding thetransform coefficient level flag, decoding the parity level flag, andderiving the quantized transform coefficient based on a value of thedecoded parity level flag and a value of the decoded first transformcoefficient level flag, and the decoding of the first transformcoefficient level flag is performed prior to the decoding of the paritylevel flag. That is, according to the present disclosure, by determining(or changing) the decoding order of the parity level flag for the parityof the transform coefficient level for the quantized transformcoefficient, and the first transform coefficient level flag related towhether or not the transform coefficient level is greater than the firstthreshold value is determined (or changed), coding efficiency can beimproved.

While in the above-described embodiments, the methods are describedbased on the flowchart having a series of steps or blocks, the presentdisclosure is not limited to the above-described order of the steps orblocks, and a certain step may occur simultaneously with other step orin a different order from that described above. Further, it may beunderstood by a person having ordinary skill in the art that the stepsshown in a flowchart is not exhaustive, and that another step may beincorporated or one or more steps of the flowchart may be removedwithout affecting the scope of the present disclosure.

The foregoing methods according to the present disclosure may beimplemented in a software form, and the encoding apparatus and/ordecoding apparatus according to the disclosure may be included in anapparatus for performing image processing of, for example, a TV, acomputer, a smartphone, a set-top box, and a display device.

When embodiments in the present disclosure are implemented in software,the above-described methods may be embodied as modules (processes,functions or the like) for performing the above-described functions. Themodules may be stored in a memory and may be executed by a processor.The memory may be inside or outside the processor and may be connectedto the processor in various well-known means. The processor may includean application-specific integrated circuit (ASIC), a different chipset,a logic circuit, and/or a data processor. The memory may include aread-only memory (ROM), a random access memory (RAM), a flash memory, amemory card, a storage medium, and/or another storage device. That is,embodiments described in the present disclosure may be embodied andperformed on a processor, a microprocessor, a controller or a chip. Forexample, functional units shown in each drawing may be embodied andperformed on a computer, a processor, a microprocessor, a controller ora chip. In this case, information (e.g., information on instructions) oralgorithm for embodiment may be stored in a digital storage medium.

Further, the decoding apparatus and the encoding apparatus to which thepresent disclosure is applied may be included in a multimediabroadcasting transceiver, a mobile communication terminal, a home cinemavideo device, a digital cinema video device, a surveillance camera, avideo chat device, a real time communication device such as videocommunication, a mobile streaming device, a storage medium, a camcorder,a video on demand (VoD) service providing device, an over the top (OTT)video device, an internet streaming service providing device, athree-dimensional (3D) video device, a virtual reality device, anaugmented reality (argumente reality) device, a video telephony videodevice, a transportation means terminal (e.g., a vehicle (including anautonomous vehicle) terminal, an aircraft terminal, a ship terminal,etc.) and a medical video device, and may be used to process a videosignal or a data signal. For example, the over the top (OTT) videodevice may include a game console, a Blu-ray player, an Internet accessTV, a Home theater system, a smartphone, a Tablet PC, a digital videorecorder (DVR) and the like.

In addition, the processing method to which the present disclosure isapplied may be produced in the form of a program executed by a computer,and be stored in a computer-readable recording medium. Multimedia datahaving a data structure according to the present disclosure may be alsostored in a computer-readable recording medium. The computer-readablerecording medium includes all kinds of storage devices and distributedstorage devices in which computer-readable data are stored. Thecomputer-readable recording medium may include, for example, a Blu-rayDisc (BD), a universal serial bus (USB), a ROM, a PROM, an EPROM, anEEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an opticaldata storage device. Further, the computer-readable recording mediumincludes media embodied in the form of a carrier wave (for example,transmission over the Internet). In addition, a bitstream generated bythe encoding method may be stored in a computer-readable recordingmedium or transmitted through a wired or wireless communication network.

Additionally, the embodiments of the present disclosure may be embodiedas a computer program product by program codes, and the program codesmay be performed in a computer by the embodiment of the disclosure. Theprogram codes may be stored on a computer-readable carrier.

FIG. 11 represents an example of a contents streaming system to whichthe present disclosure may be applied.

Referring to FIG. 11, the content streaming system to which the presentdisclosure is applied may generally include an encoding server, astreaming server, a web server, a media storage, a user device, and amultimedia input device.

The encoding server functions to compress to digital data the contentsinput from the multimedia input devices, such as the smart phone, thecamera, the camcorder and the like, to generate a bitstream, and totransmit it to the streaming server. As another example, in a case wherethe multimedia input device, such as, the smart phone, the camera, thecamcorder or the like, directly generates a bitstream, the encodingserver may be omitted.

The bitstream may be generated by an encoding method or a bitstreamgeneration method to which the present disclosure is applied. And thestreaming server may temporarily store the bitstream in a process oftransmitting or receiving the bitstream.

The streaming server transmits multimedia data to the user equipment onthe basis of a user's request through the web server, which functions asan instrument that informs a user of what service there is. When theuser requests a service which the user wants, the web server transfersthe request to the streaming server, and the streaming server transmitsmultimedia data to the user. In this regard, the contents streamingsystem may include a separate control server, and in this case, thecontrol server functions to control commands/responses betweenrespective equipments in the content streaming system.

The streaming server may receive contents from the media storage and/orthe encoding server. For example, in a case the contents are receivedfrom the encoding server, the contents may be received in real time. Inthis case, the streaming server may store the bitstream for apredetermined period of time to provide the streaming service smoothly.

For example, the user equipment may include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a personaldigital assistant (PDA), a portable multimedia player (PMP), anavigation, a slate PC, a tablet PC, an ultrabook, a wearable device(e.g., a watch-type terminal (smart watch), a glass-type terminal (smartglass), a head mounted display (HMD)), a digital TV, a desktop computer,a digital signage or the like.

Each of servers in the contents streaming system may be operated as adistributed server, and in this case, data received by each server maybe processed in distributed manner.

What is claimed is:
 1. An image decoding method performed by a decodingapparatus, the method comprising: receiving a bitstream includingresidual information; deriving a quantized transform coefficient for acurrent block based on the residual information included in thebitstream; deriving a residual sample for the current block based on thequantized transform coefficient; and generating a reconstructed picturebased on the residual sample for the current block, wherein the residualinformation includes a context-based coded context syntax element,wherein the context syntax element is decoded based on a maximum valueof context-coded bins for the current block, wherein the maximum valueis determined by a unit of a transform block, wherein the context syntaxelement includes a significant coefficient flag related to whether ornot the quantized transform coefficient is a non-zero significantcoefficient, a parity level flag related to a parity of a transformcoefficient level for the quantized transform coefficient, a firsttransform coefficient level flag related to whether or not the transformcoefficient level is greater than a first threshold value, and a secondtransform coefficient level flag related to whether or not the transformcoefficient level for the quantized transform coefficient is greaterthan a second threshold value, and wherein the maximum value is amaximum value of a sum of a number of the significant coefficient flags,a number of the parity level flags, a number of the first transformcoefficient level flags, and a number of the second transformcoefficient level flags.
 2. The image decoding method of claim 1,wherein the maximum value is determined based on the size of thetransform block.
 3. The image decoding method of claim 1, wherein whenthe sum of the number of the significant coefficient flags, the numberof the first transform coefficient level flags, the number of the paritylevel flags, and the number of the second transform coefficient levelflags derived based on a 0th quantized transform coefficient to an nthquantized transform coefficient determined by a coefficient scan orderreaches the predetermined maximum value, then explicit signaling of asignificant coefficient flag, a first transform coefficient level flag,a parity level flag, and a second transform coefficient level flag isomitted for a (n+1)th quantized transform coefficient determined by thecoefficient scan order, and a value of the (n+1)th quantized transformcoefficient is derived based on a value of coefficient level informationincluded in the residual information.
 4. The image decoding method ofclaim 3, wherein the significant coefficient flags, the first transformcoefficient level flags, the parity level flags, and the secondtransform coefficient level flags included in the residual informationare context-based coded, and the coefficient level information isbypass-based coded.
 5. The image decoding method of claim 1, wherein thecurrent block is a sub-block within the transform block.
 6. The imagedecoding method of claim 1, wherein the deriving the quantized transformcoefficient comprises: decoding the first transform coefficient levelflag and the parity level flag; and deriving the quantized transformcoefficient based on a value of the decoded parity level flag and avalue of the decoded first transform coefficient level flag, and whereinthe decoding of the first transform coefficient level flag is performedprior to the decoding of the parity level flag.
 7. An image encodingmethod performed by an encoding apparatus, the method comprising:deriving a residual sample for a current block; deriving a quantizedtransform coefficient based on the residual sample for the currentblock; and encoding residual information including information on thequantized transform coefficient, wherein the residual informationincludes a context-based coded context syntax element, wherein thecontext syntax element is encoded based on a maximum value ofcontext-coded bin for the current block, wherein the maximum value isdetermined by a unit of a transform block, wherein the context syntaxelement includes a significant coefficient flag related to whether ornot the quantized transform coefficient is a non-zero significantcoefficient, a parity level flag related to a parity of a transformcoefficient level for the quantized transform coefficient, a firsttransform coefficient level flag related to whether or not the transformcoefficient level is greater than a first threshold value, and a secondtransform coefficient level flag related to whether or not the transformcoefficient level for the quantized transform coefficient is greaterthan a second threshold value, and wherein the maximum value is amaximum value of a sum of a number of the significant coefficient flags,a number of the first transform coefficient level flags, a number of theparity level flags, and a number of the second transform coefficientlevel flags.
 8. The image encoding method of claim 7, wherein themaximum value is determined based on the size of the transform block. 9.The image encoding method of claim 7, when the sum of the number of thesignificant coefficient flags, the number of the first transformcoefficient level flags, the number of the parity level flags, and thenumber of the second transform coefficient level flags derived based ona 0th quantized transform coefficient to an nth quantized transformcoefficient determined by a coefficient scan order reaches thepredetermined maximum value, then explicit signaling of a significantcoefficient flag, a first transform coefficient level flag, a paritylevel flag, and a second transform coefficient level flag is omitted fora (n+1)th quantized transform coefficient determined by the coefficientscan order, and a value of the (n+1)th quantized transform coefficientis derived based on a value of coefficient level information included inthe residual information.
 10. The image encoding method of claim 9, thesignificant coefficient flags, the first transform coefficient levelflags, the parity level flags, and the second transform coefficientlevel flags included in the residual information are context-basedcoded, and the coefficient level information is bypass-based coded. 11.A non-transitory computer-readable storage medium storing a bitstreamgenerated by a method, the method comprising: deriving a residual samplefor a current block; deriving a quantized transform coefficient based onthe residual sample for the current block; and encoding residualinformation including information on the quantized transform coefficientto generate the bitstream, wherein the residual information includes acontext-based coded context syntax element, wherein the context syntaxelements element is encoded based on a maximum value of context-codedbins for the current block, wherein the maximum value is determined by aunit of a transform block, wherein the context syntax element includes asignificant coefficient flag related to whether or not the quantizedtransform coefficient is a non-zero significant coefficient, a paritylevel flag related to a parity of a transform coefficient level for thequantized transform coefficient, a first transform coefficient levelflag related to whether or not the transform coefficient level isgreater than a first threshold value, and a second transform coefficientlevel flag related to whether or not the transform coefficient level forthe quantized transform coefficient is greater than a second thresholdvalue, and wherein the maximum value is a maximum value of a sum of anumber of the significant coefficient flags, a number of the firsttransform coefficient level flags, a number of the parity level flags,and a number of the second transform coefficient level flags.